You will find major performance improvements by using `include` with your indexes. For instance, on something trivial like counting votes on a blog post:
create table post_vote (
post_id bigint not null references posts (id),
user_id bigint not null references users (id),
amount smallint not null,
primary key (post_id, user_id) include (amount)
);
select sum(amount) from post_vote where post_id = :'post_id';
Upvotes are 1, downvotes are -1. This will be a nearly instantaneous index-only scan summing the amount values.