2,988,001 rows slows down PostgreSQL queries in production
so I make a saas right? and its supposed to be a social media/content platform and I thought I handled everything...
the posts get pulled in paginated so users aren't querying all 2 million posts.
the issue is that the posts have millions of likes, comments, etc...
so when I'm joining tables and added up the counts with select count(*), that shit tanks performances and causes the worst load times of mankind!
how do I fix this bro? I asked AI and it sayed indexing won't work by itself.