I'm looking for a little help working through some database scaling issues with #WriteFreely.
On our Write.as instance, we're up to 4.25 million rows in our `posts` table, and it's causing problems for some individual blogs with 9,000+ posts.
I have an idea of what some bottleneck queries are. But wondering if there are easy db optimizations we might make (indexes, etc.), and if anyone can help identify what they might be.
Boosts appreciated!
@matt if you haven't already, turn on slow query logging, it will expose the problem queries and you can tune indexes from there. You didn't mention the DB engine you are using, but MySQL can be an absolute nightmare to do this, I do it all the time.
@matt Unfortuantely I know nothing about your stack or your code (other than it being MySQL-backed). However, here's the general troubleshooting lists of things that make a database-backed web application slow:
1. Too many queries: app is pulling lots of things from the DB constantly that could be cached, or doing joins in the app code
2. Unoptimized requests: some DB requests need better queries/better data structure/indexes
...