I got annoyed with seeing loglines like this from PostgreSQL:
2022-05-28 01:57:34 CEST [2992011-1] lantern@lantern LOG: duration: 606.988 ms statement: SELECT article.id, [...] ORDER BY date DESC LIMIT 7
Really? 600 ms for just getting the 7 articles for the frontpage? Admittedly including the comment count, but still!
Also, the query that generates the Archive page was identical (except for the LIMIT (and sort order)), so I refactored it to use the same base SQL-string. This could be improved to only get the fields needed on the page, but then I need to figure out how to have a partial Article data type, and I don't want to do that now.
There are still 3
connectby(); they need to be eliminated as well, but it's late,
so not tonight.
One thing I didn't leave for another day, was to get rid of a warning. Phew.