Skip to content

Commit

Permalink
MDEV-18478 ANALYZE for statement should show selectivity of ICP, part#2
Browse files Browse the repository at this point in the history
Part#2, variant 2: Make the printed r_ values in JSON output consistent.
After this patch, ANALYZE output has:

- r_index_rows (NEW) - Observed number of rows before ICP or Rowid Filtering
  checks. This is a per-scan average. like r_rows and "rows" are.

- r_rows (AS BEFORE) - Observed number of rows after ICP and Rowid Filtering.

- r_icp_filtered (NEW) - Observed selectivity of ICP condition.

- (AS BEFORE) observed selectivity of Rowid Filter is in
  $.rowid_filter.r_selectivity_pct

- r_total_filtered - Observed combined selectivity: fraction of rows left
  after applying ICP condition, Rowid Filter, and attached_condition.
  This is now comparable with "filtered" and is printed right after it.

- r_filtered (AS BEFORE) - Observed selectivity of "attached_condition".

Tabular ANALYZE output is not changed. Note that JSON's r_filtered and
r_rows have the same meanings as before and have the same meaning as in
tabular output.
  • Loading branch information
spetrunia committed Apr 23, 2024
1 parent e87d1e3 commit 0940a96
Show file tree
Hide file tree
Showing 32 changed files with 911 additions and 448 deletions.
18 changes: 12 additions & 6 deletions mysql-test/main/analyze_engine_stats.result
Expand Up @@ -40,8 +40,9 @@ X
"pages_accessed": "REPLACED"
},
"filtered": 100,
"r_filtered": 100,
"attached_condition": "t1.pk < 120000"
"r_total_filtered": 100,
"attached_condition": "t1.pk < 120000",
"r_filtered": 100
}
}
]
Expand Down Expand Up @@ -70,13 +71,14 @@ X
"access_type": "ALL",
"rows": 10000,
"r_rows": 10000,
"r_filtered": 100,
"r_total_filtered": 100,
"r_total_time_ms": "REPLACED",
"r_engine_stats": {
"pages_accessed": "REPLACED",
"pages_updated": "REPLACED"
},
"attached_condition": "t1.pk < 120000"
"attached_condition": "t1.pk < 120000",
"r_filtered": 100
}
}
}
Expand All @@ -103,13 +105,14 @@ X
"access_type": "ALL",
"rows": 10000,
"r_rows": 10000,
"r_filtered": 50,
"r_total_filtered": 50,
"r_total_time_ms": "REPLACED",
"r_engine_stats": {
"pages_accessed": "REPLACED",
"pages_updated": "REPLACED"
},
"attached_condition": "t1.pk MOD 2 = 1"
"attached_condition": "t1.pk MOD 2 = 1",
"r_filtered": 50
}
}
}
Expand Down Expand Up @@ -155,6 +158,7 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
"filtered": 100,
"r_total_filtered": 100,
"r_filtered": 100
}
},
Expand All @@ -174,6 +178,7 @@ ANALYZE
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
"r_total_filtered": 100,
"r_filtered": 100,
"materialized": {
"unique": 1,
Expand All @@ -193,6 +198,7 @@ ANALYZE
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
"filtered": 100,
"r_total_filtered": 100,
"r_filtered": 100
}
}
Expand Down

0 comments on commit 0940a96

Please sign in to comment.