Why Can a SQL Query Get Slower After I Add an Index?

Asked 1 hour ago 11 views

0

I added an index to a column used in a filter, expecting a report query to run faster. Instead, the query got slower, even though the table isn’t especially large. Is that a sign the index is poorly chosen, or can the database make a worse execution-plan choice after an index is added?

I’m wondering what to compare first: the query plan, the number of distinct values in the column, or the cost of maintaining the index as rows change. If you’ve diagnosed this, what was the clue that pointed to the cause?

0 Answers


Write Your Answer