diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2014-06-25 15:15:38 +0400 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2014-06-25 15:15:38 +0400 |
commit | 7711999d8b89d9bcf394e78a79c3c25013e249d6 (patch) | |
tree | 4c0a80ad7412c35e074e3ef91b754f71e821289a /sql/sql_explain.h | |
parent | c3cfb6910a50f7ff094b03f9ef0b5d908f5e4760 (diff) | |
download | mariadb-git-7711999d8b89d9bcf394e78a79c3c25013e249d6.tar.gz |
MDEV-406: ANALYZE $stmt: add support for BNL join buffering
Diffstat (limited to 'sql/sql_explain.h')
-rw-r--r-- | sql/sql_explain.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/sql/sql_explain.h b/sql/sql_explain.h index 7aa62111a0a..a36f1676c57 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -19,13 +19,13 @@ class Table_access_tracker { public: Table_access_tracker() : - r_scans(0), r_rows(0), r_rows_after_table_cond(0), + r_scans(0), r_rows(0), /*r_rows_after_table_cond(0),*/ r_rows_after_where(0) {} ha_rows r_scans; /* How many scans were ran on this join_tab */ ha_rows r_rows; /* How many rows we've got after that */ - ha_rows r_rows_after_table_cond; /* Rows after applying the table condition */ +// ha_rows r_rows_after_table_cond; /* Rows after applying the table condition */ ha_rows r_rows_after_where; /* Rows after applying attached part of WHERE */ bool has_scans() { return (r_scans != 0); } @@ -33,6 +33,17 @@ public: { return r_scans ? (ha_rows)rint((double) r_rows / r_scans): 0; } + + double get_filtered_after_where() + { + double r_filtered; + if (r_rows > 0) + r_filtered= (double)r_rows_after_where / r_rows; + else + r_filtered= 1.0; + + return r_filtered; + } }; @@ -371,13 +382,17 @@ enum explain_extra_tag }; -typedef struct st_explain_bka_type +class EXPLAIN_BKA_TYPE { +public: + EXPLAIN_BKA_TYPE() : join_alg(NULL) {} + bool incremental; const char *join_alg; StringBuffer<64> mrr_type; - -} EXPLAIN_BKA_TYPE; + + bool is_using_jbuf() { return (join_alg != NULL); } +}; /* @@ -517,6 +532,7 @@ public: /* ANALYZE members*/ Table_access_tracker tracker; + Table_access_tracker jbuf_tracker; private: void append_tag_name(String *str, enum explain_extra_tag tag); |