diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2014-06-25 16:46:42 +0400 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2014-06-25 16:46:42 +0400 |
commit | 424d5de89de907f37826ec8afb77769fe380d1e4 (patch) | |
tree | b12fc5dd3223c1ceb7c6ad91cbd8e444d3efc605 /sql/sql_show.h | |
parent | 787ec317784d58ca00c0c8e772173c66c5145f50 (diff) | |
parent | b561a98a87c0326dce59eb49c1b4b8f31da21d1e (diff) | |
download | mariadb-git-424d5de89de907f37826ec8afb77769fe380d1e4.tar.gz |
Merge bb-10.1-explain-analyze into 10.1
Diffstat (limited to 'sql/sql_show.h')
-rw-r--r-- | sql/sql_show.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/sql/sql_show.h b/sql/sql_show.h index 708a77d74cd..2f1cb26d17a 100644 --- a/sql/sql_show.h +++ b/sql/sql_show.h @@ -150,6 +150,69 @@ public: void call_in_target_thread(); }; +/** + Condition pushdown used for INFORMATION_SCHEMA / SHOW queries. + This structure is to implement an optimization when + accessing data dictionary data in the INFORMATION_SCHEMA + or SHOW commands. + When the query contain a TABLE_SCHEMA or TABLE_NAME clause, + narrow the search for data based on the constraints given. +*/ +typedef struct st_lookup_field_values +{ + /** + Value of a TABLE_SCHEMA clause. + Note that this value length may exceed @c NAME_LEN. + @sa wild_db_value + */ + LEX_STRING db_value; + /** + Value of a TABLE_NAME clause. + Note that this value length may exceed @c NAME_LEN. + @sa wild_table_value + */ + LEX_STRING table_value; + /** + True when @c db_value is a LIKE clause, + false when @c db_value is an '=' clause. + */ + bool wild_db_value; + /** + True when @c table_value is a LIKE clause, + false when @c table_value is an '=' clause. + */ + bool 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(); |