yeah, i might have been a bit too hasty in removing DISTINCT:
-
filtering strictly on frontend quickly desyncs LIMIT/OFFSET calculation thus breaking lazy load
-
there’s a SELECT DISTINCT ON (columns) syntax (that mysql naturally doesn’t support) which might be somewhat faster because there’s less fields to process but i haven’t really noticed:
distinct on (...) query
EXPLAIN ANALYZE SELECT DISTINCT ON (id, yyiw, ttrss_feeds.title, score , date_entered , updated )
ttrss_entries.id AS id,
date_entered,
to_char(date_entered, 'IYYY-IW') AS yyiw,
guid,
ttrss_entries.title,
updated,
label_cache,
tag_cache,
always_display_enclosures,
site_url,
note,
num_comments,
comments,
int_id,
uuid,
lang,
hide_images,
unread,feed_id,marked,published,link,last_read,orig_feed_id,
last_marked, last_published,
ttrss_feeds.title AS feed_title,favicon_avg_color,
content,
author,score
FROM
ttrss_entries LEFT JOIN ttrss_user_entries ON (ref_id = ttrss_entries.id)
LEFT JOIN ttrss_feeds ON (feed_id = ttrss_feeds.id)
WHERE
ttrss_user_entries.owner_uid = '2' AND
true ORDER BY yyiw desc, ttrss_feeds.title, score DESC, date_entered DESC, updated DESC
LIMIT 30 OFFSET 0;
i guess it’s either duplicates or using the above with fallback DISTINCT for mysql.
e: i’m honestly not sure which one of left joins or w/e else causes these duplicates, i sadly couldn’t find any on my tt-rss database. this might be one of those situations where i’m too dumb to figure something out. 