74
you are viewing a single comment's thread
view the rest of the comments
[-] solrize@lemmy.world 12 points 2 months ago

Fairly lame article but yeah this is something lemmy used to get wrong. I haven't paid attention to whether it still does.

[-] JadedBlueEyes@programming.dev 12 points 2 months ago

They fixed this in version 0.19 pr #3872 (note that the cursor here is a way of hiding a post ID to continue from, as far as I can see).

Also, lame article? ๐Ÿ˜–

[-] rimu@piefed.social 14 points 2 months ago

Not lame, I appreciated it and as a result will be implementing ID-based pagination, sometime.

[-] JadedBlueEyes@programming.dev 6 points 2 months ago

Thank you! It's lovely to hear it was helpful to someone ๐Ÿ˜Š

[-] Max_P@lemmy.max-p.me 7 points 2 months ago

Also, lame article? ๐Ÿ˜–

It's pretty short, it could be improved with benchmarks or at least some examples of how that would be implemented efficiently. Maybe a bit of pros and cons, cursor pagination for example doesn't handle "go directly to page 200" very well. I've also seen some interesting hacks to make offset pagination surprisingly fast with a clever subquery.

I wouldn't call it lame though.

[-] Ephera@lemmy.ml 15 points 2 months ago

I mean, for what it's worth, you calling it "pretty short" is what made me go read the article, because quite frankly, my attention span isn't long enough to read through an average-length article for a topic like this.

[-] laughterlaughter@lemmy.world 2 points 2 months ago

Now we're judging articles for quantity instead of quality?

[-] solrize@lemmy.world 5 points 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

[-] laughterlaughter@lemmy.world -3 points 2 months ago

Who uses "lame" in 2024? It was so pervasive during the Digg times.

this post was submitted on 19 Aug 2024
74 points (96.2% liked)

Programming

17314 readers
93 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS