mirror of
https://github.com/MariaDB/server.git
synced 2025-10-15 20:22:13 +02:00

This task loads the stats of the tables that are used in a query, from the trace into the optimizer. This feature is also controlled by optimizer_record_context, and is not enabled by default. The stats such as num_of_records present in the table, indexes if present then their names, along with the average number of records_per_key with in each index are loaded from the trace. Additionally, stats from range analysis i.e. ranges, and the corresponding number of records are also loaded from the trace. The trace context which is in JSON format is firstly set into the session variable optimizer_trace_stored_context. Later, when a user issues a query, the contents of optimizer_trace_stored_context variable is parsed and an in memory representation is build using the class Optimizer_Trace_Stored_Context_Extractor. This class is then used by the optimizer to update and save original values of the tables, indexes, and range stats in the methods "set_statistics_for_table()" of sql_statistics.cc, and "check_quick_select()" of opt_range.cc. After the query gets finished, the statistics that were updated in the optimizer are restored back to the saved original values. The entry point for parsing the json structure is in "mysql_execute_command()" of sql_parse.cc, and similarly exit point i.e. to restore the saved stats of the optimizer is at the end of the same method.
1044 lines
35 KiB
Text
1044 lines
35 KiB
Text
#enable both optimizer_trace, and optimizer_record_context
|
|
set optimizer_record_context=ON;
|
|
set optimizer_trace=1;
|
|
create database db1;
|
|
use db1;
|
|
create table t1
|
|
(
|
|
a int, b int,
|
|
index t1_idx_a (a),
|
|
index t1_idx_b (b),
|
|
index t1_idx_ab (a, b)
|
|
) ENGINE=MyISAM;
|
|
insert into t1 select seq%5, seq%8 from seq_1_to_20;
|
|
set session use_stat_tables='COMPLEMENTARY';
|
|
analyze table t1 persistent for all;
|
|
Table Op Msg_type Msg_text
|
|
db1.t1 analyze status Engine-independent statistics collected
|
|
db1.t1 analyze status Table is already up to date
|
|
#
|
|
# simple query after analyzing the table
|
|
# planner should pick the analyzed table stats
|
|
#
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
20
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
t1_idx_a ["4"]
|
|
t1_idx_b ["3"]
|
|
t1_idx_ab [
|
|
"4",
|
|
"1"
|
|
]
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
t1_idx_a ["(NULL) < (a) < (3)"] 12 0.000384
|
|
t1_idx_b ["(6) < (b)"] 2 0.000064
|
|
t1_idx_ab ["(NULL) < (a) < (3)"] 12 0.000384
|
|
#
|
|
# load stats in JSON format into variable optimizer_stored_context
|
|
# and rerun the query.
|
|
# These loaded stats are same as the analyzed stats
|
|
#
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"rec_per_key": ["3"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"rec_per_key": ["4", "1"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"ranges": ["(6) < (b)"],
|
|
"num_rows": 2,
|
|
"comp_cost": 0.000064
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
20
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
t1_idx_a ["4"]
|
|
t1_idx_b ["3"]
|
|
t1_idx_ab [
|
|
"4",
|
|
"1"
|
|
]
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
t1_idx_a ["(NULL) < (a) < (3)"] 12 0.000384
|
|
t1_idx_b ["(6) < (b)"] 2 0.000064
|
|
t1_idx_ab ["(NULL) < (a) < (3)"] 12 0.000384
|
|
#
|
|
# set the variable optimizer_stored_context to blank data
|
|
# and rerun the query.
|
|
# Analyzed table stats should be used for query planning
|
|
#
|
|
set optimizer_stored_context="";
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
20
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
t1_idx_a ["4"]
|
|
t1_idx_b ["3"]
|
|
t1_idx_ab [
|
|
"4",
|
|
"1"
|
|
]
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
t1_idx_a ["(NULL) < (a) < (3)"] 12 0.000384
|
|
t1_idx_b ["(6) < (b)"] 2 0.000064
|
|
t1_idx_ab ["(NULL) < (a) < (3)"] 12 0.000384
|
|
#
|
|
# now update the table without running analyze table, and then rerun the queries
|
|
#
|
|
insert into t1 select seq%5, seq%8 from seq_1_to_20;
|
|
#
|
|
# Only range stats are different, as the table wasn't re-analyzed
|
|
#
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
0 7
|
|
2 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
40
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
t1_idx_a ["4"]
|
|
t1_idx_b ["3"]
|
|
t1_idx_ab [
|
|
"4",
|
|
"1"
|
|
]
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
t1_idx_a ["(NULL) < (a) < (3)"] 24 0.000768
|
|
t1_idx_b ["(6) < (b)"] 4 0.000128
|
|
t1_idx_ab ["(NULL) < (a) < (3)"] 24 0.000768
|
|
#
|
|
# Now, load stats in JSON format into variable optimizer_stored_context
|
|
# and rerun the query.
|
|
# Loaded stats (including range stats) should be picked by the planner
|
|
#
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"rec_per_key": ["3"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"rec_per_key": ["4", "1"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"ranges": ["(6) < (b)"],
|
|
"num_rows": 2,
|
|
"comp_cost": 0.000064
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
0 7
|
|
2 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
20
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
t1_idx_a ["4"]
|
|
t1_idx_b ["3"]
|
|
t1_idx_ab [
|
|
"4",
|
|
"1"
|
|
]
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
t1_idx_a ["(NULL) < (a) < (3)"] 12 0.000384
|
|
t1_idx_b ["(6) < (b)"] 2 0.000064
|
|
t1_idx_ab ["(NULL) < (a) < (3)"] 12 0.000384
|
|
#
|
|
# with optimizer_record_context OFF,
|
|
# nothing gets printed to the trace
|
|
#
|
|
set optimizer_record_context=OFF;
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
0 7
|
|
2 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
#
|
|
# with optimizer_trace OFF,
|
|
# nothing gets printed to the trace
|
|
#
|
|
set optimizer_trace=0;
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
0 7
|
|
2 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
#
|
|
# Now, after re-enabling optimizer_trace, and optimizer_record_context,
|
|
# Loaded stats should be picked by the planner instead of the analyzed table stats,
|
|
# as the optimizer_stored_context is still set to a valid json containing other stats
|
|
#
|
|
set optimizer_trace=1;
|
|
set optimizer_record_context=ON;
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
0 7
|
|
2 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
20
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
t1_idx_a ["4"]
|
|
t1_idx_b ["3"]
|
|
t1_idx_ab [
|
|
"4",
|
|
"1"
|
|
]
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
t1_idx_a ["(NULL) < (a) < (3)"] 12 0.000384
|
|
t1_idx_b ["(6) < (b)"] 2 0.000064
|
|
t1_idx_ab ["(NULL) < (a) < (3)"] 12 0.000384
|
|
#
|
|
# Now, set the variable optimizer_stored_context to blank data
|
|
# and rerun the query.
|
|
# Again, old analyzed stats should be picked by the planner
|
|
# However, range stats are updated
|
|
#
|
|
set optimizer_stored_context="";
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
0 7
|
|
2 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
40
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
t1_idx_a ["4"]
|
|
t1_idx_b ["3"]
|
|
t1_idx_ab [
|
|
"4",
|
|
"1"
|
|
]
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
t1_idx_a ["(NULL) < (a) < (3)"] 24 0.000768
|
|
t1_idx_b ["(6) < (b)"] 4 0.000128
|
|
t1_idx_ab ["(NULL) < (a) < (3)"] 24 0.000768
|
|
#
|
|
# now re-analyze the table, and then rerun the queries
|
|
#
|
|
analyze table t1 persistent for all;
|
|
Table Op Msg_type Msg_text
|
|
db1.t1 analyze status Engine-independent statistics collected
|
|
db1.t1 analyze status OK
|
|
#
|
|
# All the stats are updated as the table is re-analyzed
|
|
#
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
0 7
|
|
2 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
40
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
t1_idx_a ["8"]
|
|
t1_idx_b ["5"]
|
|
t1_idx_ab [
|
|
"8",
|
|
"2"
|
|
]
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
t1_idx_a ["(NULL) < (a) < (3)"] 24 0.000768
|
|
t1_idx_b ["(6) < (b)"] 4 0.000128
|
|
t1_idx_ab ["(NULL) < (a) < (3)"] 24 0.000768
|
|
#
|
|
# Now, load stats in JSON format into variable optimizer_stored_context
|
|
# and rerun the query.
|
|
# Loaded stats (including range stats) should be picked by the planner
|
|
#
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"rec_per_key": ["3"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"rec_per_key": ["4", "1"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"ranges": ["(6) < (b)"],
|
|
"num_rows": 2,
|
|
"comp_cost": 0.000064
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
0 7
|
|
2 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
20
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
t1_idx_a ["4"]
|
|
t1_idx_b ["3"]
|
|
t1_idx_ab [
|
|
"4",
|
|
"1"
|
|
]
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
t1_idx_a ["(NULL) < (a) < (3)"] 12 0.000384
|
|
t1_idx_b ["(6) < (b)"] 2 0.000064
|
|
t1_idx_ab ["(NULL) < (a) < (3)"] 12 0.000384
|
|
#
|
|
# Now, set the variable optimizer_stored_context to blank data
|
|
# and rerun the query.
|
|
# All the re-analyzed stats should be picked by the planner
|
|
#
|
|
set optimizer_stored_context="";
|
|
select * from t1 where a < 3 and b > 6;
|
|
a b
|
|
0 7
|
|
0 7
|
|
2 7
|
|
2 7
|
|
set @trace= (select trace from information_schema.optimizer_trace);
|
|
set @records= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.num_of_records')));
|
|
select * from json_table(@records, '$[*]' columns(num_of_records text path '$')) as jt;
|
|
num_of_records
|
|
40
|
|
set @indexes=(select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.indexes')));
|
|
select * from json_table(@indexes, '$[*][*]' columns(index_name text path '$.index_name', rec_per_key json path '$.rec_per_key')) as jt;
|
|
index_name rec_per_key
|
|
t1_idx_a ["8"]
|
|
t1_idx_b ["5"]
|
|
t1_idx_ab [
|
|
"8",
|
|
"2"
|
|
]
|
|
set @list_ranges= (select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.list_ranges')));
|
|
select * from json_table(
|
|
@list_ranges,
|
|
'$[*][*]' columns(
|
|
index_name text path '$.index_name',
|
|
ranges json path '$.ranges',
|
|
num_rows int path '$.num_rows',
|
|
comp_cost double path '$.comp_cost'
|
|
)
|
|
) as jt;
|
|
index_name ranges num_rows comp_cost
|
|
t1_idx_a ["(NULL) < (a) < (3)"] 24 0.000768
|
|
t1_idx_b ["(6) < (b)"] 4 0.000128
|
|
t1_idx_ab ["(NULL) < (a) < (3)"] 24 0.000768
|
|
#
|
|
# The following tests check if there are any missing elements
|
|
# in the json structure of optimizer_stored_context variable
|
|
#
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: "name" element not present at offset 719.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: "ddl" element not present at offset 499.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: "num_of_records" element not present at offset 715.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"rec_per_key": ["4"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: "index_name" element not present at offset 463.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a"
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: "rec_per_key" element not present at offset 467.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: "index_name" element not present at offset 685.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: "ranges" element not present at offset 677.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: "num_rows" element not present at offset 695.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: "comp_cost" element not present at offset 688.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"rec_per_key": ["3"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"ranges": ["(6) < (b)"],
|
|
"num_rows": 2,
|
|
"comp_cost": 0.000064
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: db1.t1.t1_idx_ab is not in the list of index contexts loaded from optimizer_stored_context at offset 0.
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: the list of ranges for db1.t1.t1_idx_a is not in the list of range contexts loaded from optimizer_stored_context at offset 0.
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: the list of ranges for db1.t1.t1_idx_ab is not in the list of range contexts loaded from optimizer_stored_context at offset 0.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"rec_per_key": ["3"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"rec_per_key": ["4", "1"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"ranges": ["(6) < (b)"],
|
|
"num_rows": 2,
|
|
"comp_cost": 0.000064
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: the list of ranges for db1.t1.t1_idx_a is not in the list of range contexts loaded from optimizer_stored_context at offset 0.
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: db1.t1.t1_idx_ab is not in the list of range contexts loaded from optimizer_stored_context at offset 0.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t1",
|
|
"ddl": "CREATE TABLE `t1` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"rec_per_key": ["3"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"rec_per_key": ["4", "1"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"ranges": ["(6) < (b)"],
|
|
"num_rows": 2,
|
|
"comp_cost": 0.000064
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"ranges": ["(NULL) < (a) < (2)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where t1.a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: the list of ranges for db1.t1.t1_idx_a is not in the list of range contexts loaded from optimizer_stored_context at offset 0.
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: the list of ranges for db1.t1.t1_idx_ab is not in the list of range contexts loaded from optimizer_stored_context at offset 0.
|
|
set optimizer_stored_context='{
|
|
"current_database": "db1",
|
|
"list_contexts": [
|
|
{
|
|
"name": "db1.t2",
|
|
"ddl": "CREATE TABLE `t2` (\\n `a` int(11) DEFAULT NULL,\\n `b` int(11) DEFAULT NULL,\\n KEY `t1_idx_a` (`a`),\\n KEY `t1_idx_b` (`b`),\\n KEY `t1_idx_ab` (`a`,`b`)\\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci",
|
|
"num_of_records": 20,
|
|
"indexes": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"rec_per_key": ["4"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"rec_per_key": ["3"]
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"rec_per_key": ["4", "1"]
|
|
}
|
|
],
|
|
"list_ranges": [
|
|
{
|
|
"index_name": "t1_idx_a",
|
|
"ranges": ["(NULL) < (a) < (3)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
},
|
|
{
|
|
"index_name": "t1_idx_b",
|
|
"ranges": ["(6) < (b)"],
|
|
"num_rows": 2,
|
|
"comp_cost": 0.000064
|
|
},
|
|
{
|
|
"index_name": "t1_idx_ab",
|
|
"ranges": ["(NULL) < (a) < (2)"],
|
|
"num_rows": 12,
|
|
"comp_cost": 0.000384
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}';
|
|
select * from t1 where t1.a > 10;
|
|
a b
|
|
Warnings:
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: db1.t1 is not in the list of table contexts loaded from optimizer_stored_context at offset 0.
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: db1.t1.t1_idx_a is not in the list of index contexts loaded from optimizer_stored_context at offset 0.
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: db1.t1.t1_idx_b is not in the list of index contexts loaded from optimizer_stored_context at offset 0.
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: db1.t1.t1_idx_ab is not in the list of index contexts loaded from optimizer_stored_context at offset 0.
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: db1.t1.t1_idx_a is not in the list of range contexts loaded from optimizer_stored_context at offset 0.
|
|
Warning 4228 Failed to parse json structure present in the optimizer_stored_context variable: db1.t1.t1_idx_ab is not in the list of range contexts loaded from optimizer_stored_context at offset 0.
|
|
drop table t1;
|
|
drop database db1;
|