Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
EXPLAIN currently supports SELECT queries that target information_schema tables. For example, these queries are valid:
EXPLAIN SELECT * FROM information_schema.TABLES
|
WHERE TABLE_SCHEMA='db1';
|
|
EXPLAIN SELECT * FROM information_schema.TRIGGERS
|
WHERE EVENT_OBJECT_SCHEMA='db1';
|
|
EXPLAIN SELECT * FROM information_schema.GLOBAL_VARIABLES
|
WHERE VARIABLE_NAME='character_set_server';
|
Sometimes this functionality is very important, because innocent-looking SELECT queries that target information_schema tables can actually cause serious performance issues. For example, see here:
https://dev.mysql.com/doc/refman/5.7/en/information-schema-optimization.html
However, one problem is that if we convert the above SELECT queries to their equivalent SHOW queries, then EXPLAIN fails. For example:
EXPLAIN SHOW TABLE STATUS
|
FROM db1;
|
|
EXPLAIN SHOW TRIGGERS
|
FROM db1;
|
|
EXPLAIN SHOW GLOBAL VARIABLES
|
WHERE VARIABLE_NAME='character_set_server';
|
Some of these SHOW queries can probably have similar problems as SELECT queries that target information_schema tables.
If so, then wouldn't it make sense to implement EXPLAIN for them as well?
Attachments
Issue Links
- relates to
-
MDEV-30340 Implement EXPLAIN for DDL such as ALTER TABLE
- Open