2 ms·
Question - how well does the query parser handle stale queries? SQL Server for the longest time had issues with plan stability in that the plan became too stabl
by chris_wot 14y ago
Question - how well does the query parser handle stale queries? SQL Server for the longest time had issues with plan stability in that the plan became too stable. When the data distribution changed dramatically, the queries didn't age out of the cache and the queries would do such things as use the wrong index, or not work out the correct cardinality of a table and then use an index where really a full table scan would have been better... and so on.
How does the database handle this sort of thing?
- nikita 14y agoRight now you can handle this with query hints. The plans are stable, but they are attached to the query text. When you throw a hint in there memsql generates a new plan since the query text changes.
- chris_wot 14y agoTo clarify - if you add the query hint, run the query, then remove the query hint then has the original query's plan expired? Edit: I know I'm asking a lot about the plan cache, but as it's a core selling point, then I'd like to know how data distribution changes will affect performance. Stale queries will potentially adversley affect performance under certain circumstances.
- tintor 14y agoNo, original query plan will only expire if indexes are dropped or new ones are created.