optimize query statements summary table by avoid decode plan by conditional pushdown #26379
Labels
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
type/enhancement
The issue or PR belongs to an enhancement.
type/performance
Background
PR #25843 enlarge the
tidb_stmt_summary_max_stmt_count
default value to 3000. It's great for diagnose problem since thestatements_summary
can record more SQL. But it will also slow down the performance when querystatements_summary
. Mostly the reasons affecting performance is cause byDecodePlan
for each row instatements_summary
.#25892 already has optimized the performance by prune column. But it doesn't optimize for the following SQL which will be used in tidb-dashboard:
The upper SQL need query all columns value, so #25892 which use prune column method can't optimize it.
But we can use
conditional pushdown
to do optimization. As you can see the condition isdigest='8019af26debae8aa7642c501dbc43212417b3fb14e6aec779f709976b7e521be' and unix_timestamp(summary_begin_time) = 1626769800
. Mostly There is very little data that meets this condition, so we can useconditional pushdown
to only fetch the row which meets the condition.Reference
How to do conditional pushdown for query system table?
MemTablePredicateExtractor
to implements conditional pushdown.You can reference the following PR which also do conditional pushdown for query system table:
tiflash_tables
andtiflash_segments
#18092mentor
If you have any questions about this issue, you can comment on this issue, I will reply you as soon as possible.
The text was updated successfully, but these errors were encountered: