1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-30806: ANALYZE FORMAT=JSON: better support for BNL and BNL-H joins

In block-nl-join, add:

- r_loops - this shows how many incoming record combinations this
  query plan node had.

- r_effective_rows - this shows the average number of matching rows
  that this table had for each incoming record combination. This is
  comparable with r_rows in non-blocked access methods.
  For BNL-joins, it is always equal to
   $.table.r_rows * $.table.r_filtered
  For BNL-H joins the value cannot be computed from other values

Reviewed by: Monty <monty@mariadb.org>
This commit is contained in:
Sergei Petrunia
2023-03-07 19:49:57 +03:00
parent 169def14f6
commit dc1d6213f9
14 changed files with 279 additions and 30 deletions

View File

@@ -21231,6 +21231,8 @@ sub_select_cache(JOIN *join, JOIN_TAB *join_tab, bool end_of_records)
/* The user has aborted the execution of the query */
DBUG_RETURN(NESTED_LOOP_KILLED);
}
join_tab->jbuf_loops_tracker->on_scan_init();
if (!test_if_use_dynamic_range_scan(join_tab))
{
if (!cache->put_record())
@@ -27393,6 +27395,7 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta,
// psergey-todo: data for filtering!
tracker= &eta->tracker;
jbuf_tracker= &eta->jbuf_tracker;
jbuf_loops_tracker= &eta->jbuf_loops_tracker;
/* Enable the table access time tracker only for "ANALYZE stmt" */
if (thd->lex->analyze_stmt)