Skip to content

Reduce redundant pack reads during building bitmap filter for delta merge case (release-8.5)#10293

Merged
ti-chi-bot[bot] merged 17 commits intopingcap:release-8.5from
JaySon-Huang:pick_9876_85
Sep 27, 2025
Merged

Reduce redundant pack reads during building bitmap filter for delta merge case (release-8.5)#10293
ti-chi-bot[bot] merged 17 commits intopingcap:release-8.5from
JaySon-Huang:pick_9876_85

Conversation

@JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Jul 9, 2025

Pick #9876 and a part of #9738 to release-8.5

What problem does this PR solve?

Issue Number: close #9875

Problem Summary:
According to #9876, this would gain overall 26.5% Improvement on CHBenchmark 1500 with update workloads.

What is changed and how it works?

The performance benchmark on release-8.5, overall 27% Improvement #10293 (comment)

Reduce redundant pack reads during bitmap filter building for delta merge case

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Improve the performance of `TableScan` by skipping unnecessary row reads

Signed-off-by: JaySon-Huang <tshent@qq.com>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/cherry-pick-not-approved do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 9, 2025
Signed-off-by: JaySon-Huang <tshent@qq.com>
@JaySon-Huang
Copy link
Contributor Author

/test pull-unit-test

JaySon-Huang and others added 10 commits July 10, 2025 00:41
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Sep 25, 2025
@JaySon-Huang JaySon-Huang changed the title [WIP] Reduce redundant pack reads during building bitmap filter for delta merge case [WIP] Reduce redundant pack reads during building bitmap filter for delta merge case (release-8.5) Sep 25, 2025
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
@JaySon-Huang JaySon-Huang changed the title [WIP] Reduce redundant pack reads during building bitmap filter for delta merge case (release-8.5) Reduce redundant pack reads during building bitmap filter for delta merge case (release-8.5) Sep 25, 2025
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 25, 2025
@JaySon-Huang
Copy link
Contributor Author

/hold
wait for testing

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 25, 2025
gengliqi and others added 3 commits September 25, 2025 23:42
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
@ti-chi-bot ti-chi-bot bot added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Sep 26, 2025
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 26, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 26, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 26, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-09-26 06:57:09.897290841 +0000 UTC m=+599039.967784511: ☑️ agreed by Lloyd-Pottiger.
  • 2025-09-26 07:29:49.130013114 +0000 UTC m=+600999.200506797: ☑️ agreed by JinheLin.

@gengliqi
Copy link
Contributor

Before: dbd76e7
After: 5758756
Run CHBenchmark 1500 warehouse.

mysql> select TIDB_TABLE, sum(DELTA_MEMTABLE_ROWS+DELTA_PERSISTED_ROWS) delta_rows, sum(stable_rows) stable_rows from INFORMATION_SCHEMA.TIFLASH_SEGMENTS where TIDB_DATABASE='chbench_delta' group by TIDB_TABLE order by stable_rows, delta_rows;
+------------+------------+-------------+
| TIDB_TABLE | delta_rows | stable_rows |
+------------+------------+-------------+
| region     |         10 |           0 |
| nation     |         50 |           0 |
| district   |      30000 |           0 |
| supplier   |      36384 |           0 |
| warehouse  |       2712 |         288 |
| item       |          0 |      200000 |
| new_order  |     200772 |    26917020 |
| orders     |    1136056 |    89873752 |
| customer   |    1683216 |    89931328 |
| history    |     917957 |    89987264 |
| stock      |    4821696 |   296328727 |
| order_line |   22772241 |   880956623 |
+------------+------------+-------------+
12 rows in set (0.09 sec)

mysql> select sum(DELTA_MEMTABLE_ROWS+DELTA_PERSISTED_ROWS) delta_rows, sum(stable_rows) stable_rows, 100 * sum(DELTA_MEMTABLE_ROWS+DELTA_PERSISTED_ROWS) / sum(stable_rows) delta_percent from INFORMATION_SCHEMA.TIFLASH_SEGMENTS where
TIDB_DATABASE='chbench_delta';
+------------+-------------+---------------+
| delta_rows | stable_rows | delta_percent |
+------------+-------------+---------------+
|   31601094 |  1474195002 |        2.1436 |
+------------+-------------+---------------+
1 row in set (0.08 sec)

Overall 27% Improvement

Basically the same as the test results of #9876.

Query Before After Improvement
Q1 3.15 1.27 248%
Q2 1.75 0.95 184%
Q3 4.39 1.9 231%
Q4 5.14 2.96 174%
Q5 14.65 11.99 122%
Q6 3.01 1 301%
Q7 8.32 5.8 143%
Q8 4.88 2.51 194%
Q9 43.02 40.58 106%
Q10 33.95 31.2 109%
Q11 1.48 0.62 239%
Q12 5.37 3.35 160%
Q13 0.74 0.4 185%
Q14 4.11 2.18 189%
Q15 14.2 9.66 147%
Q16 10.66 10 107%
Q17 6.28 2.29 274%
Q18 31.95 30.17 106%
Q19 0.16 0.07 229%
Q20 4.2 1.8 233%
Q21 10.3 5.74 179%
Q22 0.46 0.1 460%
Sum 212.17 166.54 127%

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 26, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gengliqi, JinheLin, Lloyd-Pottiger

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [JinheLin,Lloyd-Pottiger,gengliqi]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@JaySon-Huang
Copy link
Contributor Author

Waiting for the internal end-2-end consistency-workload testing: https://tcms.pingcap.net/dashboard/executions/plan/7938394

@JaySon-Huang
Copy link
Contributor Author

/unhold

The internal testing passed without issue

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 27, 2025
@ti-chi-bot ti-chi-bot bot merged commit b73e7a2 into pingcap:release-8.5 Sep 27, 2025
4 checks passed
@JaySon-Huang JaySon-Huang deleted the pick_9876_85 branch September 27, 2025 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants