this post was submitted on 19 Feb 2024
32 points (100.0% liked)

PostgreSQL

652 readers
15 users here now

The world's most advanced open source relational database

Project
Events
Podcasts
Related Fediverse communities

founded 1 year ago
MODERATORS
 

Lemmy currently uses distinct tables like post_like: (post_id, person_id, score) and post_saved. Unfortunately this causes performance issues when we have to join many of these tables to create views.

One suggestion in this PR, is to combine these into a single post_action table, with a lot of optional columns depending on the action. This solution scares me a little, because I'm afraid we might lose data integrity, and many of our constraints with so many optional columns.

Is there a better way of doing this in SQL?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] xmunk@sh.itjust.works 6 points 8 months ago (1 children)

CharGPT has its uses, performance tuning is not (yet) one of them. I think ML in performance tuning will eventually be a huge deal when we can leverage rapid iterations and culling to perform a wide number of small tweaks and compare performance... I haven't seen a good solution to this yet, it's a really complex problem, but I think it's inevitable.

[โ€“] technom@programming.dev 1 points 8 months ago

Isn't that what genetic algorithms were about?