Hmm, ok, something weird and pg specific might be going on. JOIN to an empty or almost empty table (I guess you mean outer join) sounds surpising but I’d hope the query planner can still do something reasonable. Anyway I don’t feel like I’m being helpful at this point, so I’ll stay out of your way. I’ll be interested to know how it goes though.
What can I say, that sounds suspicious both from the PG side (complex queries with lots of joins are sometimes useful, such as for reporting) and on the Lemmy side (executing such queries in response to routine web requests is a pretty bad smell). It’s still early days so this seems like a better time to re-examine the schema and migrate if necessary, than after waiting until there’s a ton more data and activity.
Hmm, ok, something weird and pg specific might be going on. JOIN to an empty or almost empty table (I guess you mean outer join) sounds surpising but I’d hope the query planner can still do something reasonable. Anyway I don’t feel like I’m being helpful at this point, so I’ll stay out of your way. I’ll be interested to know how it goes though.
PostgreSQL specifically guards against queries with more than 8 joins… and Lemmy plows right past that.
What can I say, that sounds suspicious both from the PG side (complex queries with lots of joins are sometimes useful, such as for reporting) and on the Lemmy side (executing such queries in response to routine web requests is a pretty bad smell). It’s still early days so this seems like a better time to re-examine the schema and migrate if necessary, than after waiting until there’s a ton more data and activity.
Lemmy has been on GitHub since February 2019, over four years. It isn’t new at all. Several instances go way back.
The answer is: ORM.