maria:bb-11.4-MDEV-18478-v4-MDEV-12404

Last commit made on 2024-04-16
Get this branch:
git clone -b bb-11.4-MDEV-18478-v4-MDEV-12404 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-11.4-MDEV-18478-v4-MDEV-12404
Repository:
lp:maria

Recent commits

6aeb402... by Dave Gosselin <email address hidden>

remove unused function should_collect_handler_stats

51cd630... by Dave Gosselin <email address hidden>

We rely on handler_stats pointing to a valid active_handler_stats instance, for ICP accounting, which is created during ha_handler_stats_reset(). Always invoke that method during table init to ensure that the handler, regardless of implementation, has the pointer set correctly

4ab074b... by Dave Gosselin <email address hidden>

fixup handler_stats pointer for icp

06c2ad7... by Dave Gosselin <email address hidden>

accrue statistics to correct handler

8f8585b... by Sergey Petrunia

Fixup 2 for MDEV-18478 ANALYZE for statement part#2

We may get r_index_rows=0. Do not divide by 0 in this case,
as the result is undefined. Produce "r_total_filtered": 100 instead.

f7abf4a... by Sergei Golubchik

fixup MDEV-18478 ANALYZE for statement part#2

Error:Run-Time Check Failure #3 - The variable 'r_filtered' is being used without being initialized. At :0

da4e129... by Sergey Petrunia

MDEV-12404: Add assertions about Index Condition Pushdown use

Add assertions about limitations one has when using Index Condition
Pushdown:
- add handler::assert_icp_limitations()
- call this function from functions that may attempt violations.

Verified that assert_icp_limitations() as well as calls to it are
compiled away in release build.

817b8d4... by Dave Gosselin <email address hidden>

MDEV-12404 Index condition pushdown on partitioned tables

Support index condition pushdown within partitioned tables.
- ha_partition will pass the pushed index condition into all of the used
  partitions.
  - We require that all of the partitions to handle the pushed index
    condition in the same way.
- When using ICP, one may read rows (e.g. call h->index_read_map(buf, ...)
  only to buf= table->record[0], for two reasons:
  * Pushed index condition's Item_field objects point into record[0]
  * InnoDB requires this: it calls offset() which assumes record[0].
  So, when using ICP, ha_partition will read partition records to
  table->record[0] and then will copy record away if it needs it to be
  elsewhere.

e025d70... by Sergey Petrunia

MDEV-18478: part 3: late code cleanups, no functional changes.

01df049... by Sergey Petrunia

MDEV-18478 ANALYZE for statement should show selectivity of pushed index condition

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.