summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-11-16 14:26:13 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-11-16 14:26:13 +0200
commit09205a1c9a3003bd4367eb87e408918215e33fd7 (patch)
tree0eeaab264a30160edb356c9d16c1457d2bb34ddf /sql/opt_range.cc
parent0269d491eaf02556817654e6365ebf50eb4616fc (diff)
parentd270525dfde86bcb92a2327234a0954083e14a94 (diff)
downloadmariadb-git-09205a1c9a3003bd4367eb87e408918215e33fd7.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 9ec8781bc30..b573dc25ef0 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -370,7 +370,7 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
double read_time);
static
TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
- double read_time);
+ double read_time, bool named_trace= false);
static
TABLE_READ_PLAN *merge_same_index_scans(PARAM *param, SEL_IMERGE *imerge,
TRP_INDEX_MERGE *imerge_trp,
@@ -5085,7 +5085,7 @@ double get_sweep_read_cost(const PARAM *param, ha_rows records)
static
TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
- double read_time)
+ double read_time, bool named_trace)
{
SEL_TREE **ptree;
TRP_INDEX_MERGE *imerge_trp= NULL;
@@ -5133,7 +5133,8 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
n_child_scans)))
DBUG_RETURN(NULL);
- Json_writer_object trace_best_disjunct(thd);
+ const char* trace_best_disjunct_obj_name= named_trace ? "best_disjunct_quick" : nullptr;
+ Json_writer_object trace_best_disjunct(thd, trace_best_disjunct_obj_name);
Json_writer_array to_merge(thd, "indexes_to_merge");
/*
Collect best 'range' scan for each of disjuncts, and, while doing so,
@@ -5489,7 +5490,7 @@ TABLE_READ_PLAN *merge_same_index_scans(PARAM *param, SEL_IMERGE *imerge,
DBUG_ASSERT(imerge->trees_next>imerge->trees);
if (imerge->trees_next-imerge->trees > 1)
- trp= get_best_disjunct_quick(param, imerge, read_time);
+ trp= get_best_disjunct_quick(param, imerge, read_time, true);
else
{
/*
@@ -5677,7 +5678,7 @@ void print_keyparts(THD *thd, KEY *key, uint key_parts)
DBUG_ASSERT(thd->trace_started());
KEY_PART_INFO *part= key->key_part;
- Json_writer_array keyparts= Json_writer_array(thd, "keyparts");
+ Json_writer_array keyparts(thd, "keyparts");
for(uint i= 0; i < key_parts; i++, part++)
keyparts.add(part->field->field_name);
}