• solrize@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    2 months ago

    Ah, thanks for linking that PR. The point made in the article is a good and helpful one, as can be seen by the way so many sites get it wrong, including Lemmy in the past. It’s just that it is pretty thin to make a whole article around. It would be a good thing to bring up in an optimization guide that covers more topics.

    I would be interested to know if there is substantial cost to keeping cursors open for long periods, while the db is being updated. I think given those labels, it may be preferable to do a new select each time the user requests the next page. But I haven’t benchmarked that.

    If you look at how Wikipedia pages through article histories, the labels are timestamps with 1 second resolution.

    Here is another article about the same topic, part of the author’s book on SQL performance:

    https://use-the-index-luke.com/sql/partial-results/fetch-next-page