summaryrefslogtreecommitdiff
path: root/sql/sql_explain.h
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2014-11-28 22:23:29 +0300
committerSergei Petrunia <psergey@askmonty.org>2014-11-28 22:23:29 +0300
commit2ac3b39e68bf6bf1b56e6eafd290c0a78368d0be (patch)
tree4b02aba6761e6fa6291f8ce70578ea3377c848fc /sql/sql_explain.h
parent3a5e080d4dbe58675e6324eaa807bc2c7aa8795d (diff)
downloadmariadb-git-2ac3b39e68bf6bf1b56e6eafd290c0a78368d0be.tar.gz
EXPLAIN FORMAT=JSON: support derived tables
Diffstat (limited to 'sql/sql_explain.h')
-rw-r--r--sql/sql_explain.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/sql_explain.h b/sql/sql_explain.h
index 5fd1d5ec59a..5b2bf9fdb27 100644
--- a/sql/sql_explain.h
+++ b/sql/sql_explain.h
@@ -92,9 +92,16 @@ public:
EXPLAIN_INSERT
};
+ Explain_node() : is_derived_table(false) {}
+
virtual enum explain_node_type get_type()= 0;
virtual int get_select_id()= 0;
+ /*
+ TRUE means this is a derived table. FALSE means otherwise.
+ */
+ bool is_derived_table;
+
/*
A node may have children nodes. When a node's explain structure is
created, children nodes may not yet have QPFs. This is why we store ids.
@@ -494,6 +501,7 @@ class Explain_table_access : public Sql_alloc
{
public:
Explain_table_access() :
+ derived_select_number(0),
where_cond(NULL),
cache_cond(NULL),
pushed_index_cond(NULL)
@@ -512,6 +520,12 @@ public:
/* id and 'select_type' are cared-of by the parent Explain_select */
StringBuffer<32> table_name;
+ /*
+ Non-zero number means this is a derived table. The number can be used to
+ find the query plan for the derived table
+ */
+ int derived_select_number;
+
enum join_type type;
StringBuffer<32> used_partitions;
@@ -581,7 +595,8 @@ public:
bool is_analyze,
uint select_id, const char *select_type,
bool using_temporary, bool using_filesort);
- void print_explain_json(Json_writer *writer, bool is_analyze);
+ void print_explain_json(Explain_query *query, Json_writer *writer,
+ bool is_analyze);
/* ANALYZE members*/
Table_access_tracker tracker;