diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2014-06-24 19:41:43 +0400 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2014-06-24 19:41:43 +0400 |
commit | c08de06246f776c557b7795d53e2a956e156f533 (patch) | |
tree | 6c9ed33855eeb6c418fe390deef7f62db91d6d36 /sql/sql_show.h | |
parent | 581b889771447f7a9f33d467f0b5ef2aa96e072b (diff) | |
download | mariadb-git-c08de06246f776c557b7795d53e2a956e156f533.tar.gz |
MDEV-406: ANALYZE $stmt: get ANALYZE work for subqueries
- "ANALYZE $stmt" should discard select's output, but it should still
evaluate the output columns (otherwise, subqueries in select list
are not executed)
- SHOW EXPLAIN's code practice of calling JOIN::save_explain_data()
after JOIN::exec() is disastrous for ANALYZE, because it resets
all counters after the first execution. It is stopped
= "Late" test_if_skip_sort_order() calls explicitly update their part
of the query plan.
= Also, I had to rewrite I_S optimization to actually have optimization
and execution stages.
Diffstat (limited to 'sql/sql_show.h')
-rw-r--r-- | sql/sql_show.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sql/sql_show.h b/sql/sql_show.h index 708a77d74cd..96f271d34c1 100644 --- a/sql/sql_show.h +++ b/sql/sql_show.h @@ -150,6 +150,41 @@ public: void call_in_target_thread(); }; +typedef struct st_lookup_field_values +{ + LEX_STRING db_value, table_value; + bool wild_db_value, wild_table_value; +} LOOKUP_FIELD_VALUES; + + +/* + INFORMATION_SCHEMA: Execution plan for get_all_tables() call +*/ + +class IS_table_read_plan : public Sql_alloc +{ +public: + IS_table_read_plan() : no_rows(false) {} + + bool no_rows; + + LOOKUP_FIELD_VALUES lookup_field_vals; + Item *partial_cond; + + bool has_db_lookup_value() + { + return (lookup_field_vals.db_value.length && + !lookup_field_vals.wild_db_value); + } + bool has_table_lookup_value() + { + return (lookup_field_vals.table_value.length && + !lookup_field_vals.wild_table_value); + } +}; + +bool optimize_schema_tables_reads(JOIN *join); + /* Handle the ignored database directories list for SHOW/I_S. */ bool ignore_db_dirs_init(); void ignore_db_dirs_free(); |