The Lemmy dev team could use some help with their database issues - Lemmy.world

https://lemmy.world/post/7414

Is there anyone out there with database expertise willing to help?

36 points · 9 comments · view on lemmy.world

9 Comments

Penguincoder@beehaw.org · 5 pts · 3y (4 replies)

Question really is why is it developed that way? Why does it need to do a reindex every hour? I have not looked at Lemmy source code, but wondering if a trigger function could do the same thing.

ericjmorey@beehaw.org · 7 pts · 3y

I'm going to guess inexperience and a focus on developing other parts of Lemmy.

aaronbieber@beehaw.org · 3 pts · 3y (1 reply)

(Apparently the UI allows you to edit your own deleted comment, but saving it doesn't un-delete it, you just lose what you wrote... Bummer!)

In the conversation on Github, it looks like they considered a trigger and some other options based on DB query analyses, and arrived at a solution. It requires code refactoring, though, so I wouldn't expect it to be out in the wild right away.

ericjmorey@beehaw.org · 3 pts · 3y

There's a branch that likely fixes the issue with a pull request to main, but it failed some automated testing and needs to be tested in main before a new release. The timing of this is unfortunate. I suspect Monday and Tuesday to have many 50x codes on any instances that get attention.

aaronbieber@beehaw.org · 1 pts · 3y

In the conversation on Github it looks like they considered a trigger and looked at a ton of database query analyses and found a promising direction to go in.

The change requires code refactoring, though, so I wouldn't expect it to land in a stable version of Lemmy for a little bit.

pitninja@lemmy.ml · 4 pts · 3y (2 replies)

I'm also curious why every page view (to be clear, do you mean every time a post is viewed?) triggers a recalc on the Hot score. I would think you could recalc that like every 5 minutes and be just fine. (If people are refreshing a feed more frequently than every 5 minutes, they should be expecting to see the same thing most of the time).

ericjmorey@beehaw.org · 5 pts · 3y (1 reply)

I’m also curious why every page view (to be clear, do you mean every time a post is viewed?) triggers a recalc on the Hot score.

This is the current design, yes. I believe the devs have already started a related issue to change this. I'm assuming the next version of Lemmy will have some major performance improvements.

pitninja@lemmy.ml · 6 pts · 3y

Yeah, just thinking about things logically here, the more they can automate expensive queries on the back end on a more periodic basis and then cache the results regardless of what's happening with page views on the front end, the better things should be. It's a lot cheaper for a database to serve cached results in lookups. I'm not a database guy and not really qualified to help fix any of these issues, but I'm just drawing from what I remember from my databases course in college.

duskfall@lemmy.world · 1 pts · 1y
[ removed ]