mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Add --optimizer_trace option to mysqltest
This enables optimizer_trace output for the next SQL command. Identical as if one would have done: - Store value of @@optimizer_trace - Set @optimizer_trace="enabled=on" - Run query - SELECT * from OPTIMIZER_TRACE - Restore value of @@optimizer_trace This is a great time saver when one wants to quickly check the optimizer trace for a query in a mtr test.
This commit is contained in:
@@ -48,12 +48,12 @@ create view v1 as select a from t1 group by b;
|
||||
create view v2 as select a from t2;
|
||||
|
||||
--echo # Mergeable view
|
||||
--optimizer_trace
|
||||
explain select * from v2 ;
|
||||
select * from information_schema.OPTIMIZER_TRACE;
|
||||
|
||||
--echo # Non-Mergeable view
|
||||
--optimizer_trace
|
||||
explain select * from v1 ;
|
||||
select * from information_schema.OPTIMIZER_TRACE;
|
||||
drop table t1,t2;
|
||||
drop view v1,v2;
|
||||
|
||||
|
Reference in New Issue
Block a user