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?
Why not just ask chatgpt?
I’m pretty sure the developers have better than chatgpt level knowledge. There’s a reason they’re asking for experts
lol, lmao
You’re getting downvoted, but it’s not the worst idea to ask it in the general sense:
Q: is which cases is denormalization of sql tables a good idea? especially PostgreSQL?
A: