Open qw4990 opened 4 years ago
We can use this feature(https://github.com/pingcap/tidb/issues/18117) to remove the limitation.
I reopened this issue because extra works will be needed after #18117 is finished. 1) an interface to let users dump historical statistics according to a timestamp 2) a default GC time for the statistics tables.
The design doc(Chinese version) designed by @An-DJ and the work items:
mysql.stats_meta_history
Feature Request
Is your feature request related to a problem? Please describe:
There are some cases that when we(developer) get the wrong execution plan, statistics have been updated by
auto-analyze
or users without intention, which makes it harder to reproduce the plan and locate the reason.Describe the feature you'd like:
Support to export historical statistics. There is already an API that can do this, but it has a strict limitation that the specified time cannot be earlier
tikv_gc_run_interval
minutes than the current time. (The default value oftikv_gc_run_interval
is 10 minutes) This limitation makes this API hard to be used in realistic cases.It's better to design a new way to implement this feature.
Teachability, Documentation, Adoption, Migration Strategy:
Export statistics in TiDB