Some SOQL queries in our org used to run quickly, but as data volume increased, response times degraded. The queries themselves haven’t changed much, and indexes exist on some fields. I’m trying to understand what causes SOQL performance to decline over time and how it’s usually addressed?
SOQL performance is heavily influenced by data distribution, selectivity, and query patterns. As tables grow, queries that were once selective may no longer be, especially if filters rely on non-indexed fields or skewed data. Complex WHERE clauses and large result sets also add overhead.
Improving performance usually involves rewriting queries to be more selective, using indexed fields, reducing returned fields, and sometimes redesigning data models.
Takeaway: SOQL performance problems usually reflect data growth, not bad syntax.