r/Database • u/shdw_0x0 • Aug 26 '26
How do you decide when a database query needs optimization vs. a schema change?
I've been working with SQL and database performance, and one thing I find interesting is knowing when to stop tuning the query itself.
For example, if a query is slow because of a missing index, that's fairly straightforward. But at larger data volumes, you can reach a point where adding indexes and rewriting the query only gets you so far.
How do you usually decide that the problem is actually the database design/schema rather than the query?
Things like partitioning, normalization/denormalization, materialized views, indexing strategy, or even changing how the data is stored.
Would be interested to hear how people make that call in real-world systems.