|
|
See issue 194 and 199 for related requests.
This feature request is to fingerprint a query's EXPLAIN plan. During a
review, capture the EXPLAIN of the worst-sample, and save that,
primary-keyed on fingerprint of the EXPLAIN, in another table. Then we
need some way to notice when the plan changes. For example, right now if I
see a query is bad and note that it needs an index, and we add the index,
in the future the plan might change. I have reviewed the query, **but I
have not reviewed that plan.** This query needs attention again.
So really, I want to review the combination of query and plan.
I also want some way to capture a random sample of different queries
besides just the worst-sample, and look whether they all have the same
plan. If they do, then notify me in the output: there are X plans (and
maybe show the distribution).
How to capture these without knowing in advance how many queries there will
be: say I want 5 samples. I capture the first 5 samples, then every 100th
after that until I get to 50 total, then every 10000th after that... at the
end, I re-sample among the collected ones.
|