Closed lemon24 closed 3 years ago
Used the following indices, all confirmed to work for the relevant query with explain query plan
:
create index feeds_by_kinda_title on feeds(
lower(coalesce(user_title, title, '')) ASC,
url ASC
);
create index feeds_by_added on feeds(
added desc,
url desc
);
create index entries_by_feed on entries(
feed
);
The ones on feeds
didn't really help (likely because there are so few feeds in the first place).
The one on entries
made the with-counts page load time 2-3x faster.
OK, after adding entries_by_feed
, /feeds?counts=yes on my deployment dropped down to .4s (4x faster).
In two ways (all timings on my deployment):
feeds
on the feed sort keys.entries
on the feed (may enable faster counting).get_entry_counts(feed=...)
as feed metadata after feed updates, and return that instead.