Repository navigation
perf(disttae): index tombstone object ranges - #26476
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head 4bb4fc7. The interval query is equivalent to the existing object-level RowidPrefixEq check, retains unindexed objects conservatively, restores visible-object order before I/O, and is scoped to the fixed data-source snapshot/lifetime. Focused equivalence, integration, iterator, and race tests pass. No actionable issues found.
Merge Queue Status
This pull request spent 31 minutes 9 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #26476 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
Failing checks:
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
## What type of PR is this? - [x] Improvement ## Which issue(s) this PR fixes: Related to matrixorigin#26465 ## What this PR does / why we need it: After matrixorigin#26470 removed the per-object allocation, large table scans still test every visible tombstone object for every data block. The QA workload in matrixorigin#26465 has system tables with roughly 700 visible tombstone objects and scans roughly 132 data blocks per statement, resulting in about 92,000 object-level Rowid zone-map checks per scan. This PR builds a per-data-source interval index from each tombstone object's Rowid zone-map block range: - ranges are sorted by minimum block ID and carry a cumulative maximum; - each data block queries only intervals that can contain its block ID; - candidate objects are restored to the original visible-object order before the existing tombstone reader is called, preserving read and error order; - objects without an initialized Rowid zone map remain unconditional candidates because they cannot be safely excluded; - scans below 32 blocks keep the existing allocation-free linear iterator to avoid paying the index construction cost for small reads; - the index and candidate scratch space are released when the data source is closed. The existing object/block zone-map checks remain in place. This changes only candidate selection, not tombstone visibility or deletion semantics. Validation: - `go test ./pkg/vm/engine/disttae -count=1` - `go test -race ./pkg/vm/engine/disttae -run '^TestTombstoneObjectIndex' -count=1` - exhaustive equivalence test over 701 objects and 1,100 block IDs - QA-shape benchmark (700 tombstone objects, 132 data blocks, 5 iterations): - linear scan: about 501 us/op - index build: about 72 us/op, 57,344 B/op, 1 alloc/op - indexed block queries: about 11.8 us/op, 0 B/op - build plus queries is about 6x faster than the linear scan This is intentionally separate from the cgroup pressure handling in matrixorigin#26471. It reduces the work generated by the workload but does not claim to solve all sources of CN memory pressure by itself. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [x] Improvement ## Which issue(s) this PR fixes: Related to matrixorigin#26465 ## What this PR does / why we need it: After matrixorigin#26470 removed the per-object allocation, large table scans still test every visible tombstone object for every data block. The QA workload in matrixorigin#26465 has system tables with roughly 700 visible tombstone objects and scans roughly 132 data blocks per statement, resulting in about 92,000 object-level Rowid zone-map checks per scan. This PR builds a per-data-source interval index from each tombstone object's Rowid zone-map block range: - ranges are sorted by minimum block ID and carry a cumulative maximum; - each data block queries only intervals that can contain its block ID; - candidate objects are restored to the original visible-object order before the existing tombstone reader is called, preserving read and error order; - objects without an initialized Rowid zone map remain unconditional candidates because they cannot be safely excluded; - scans below 32 blocks keep the existing allocation-free linear iterator to avoid paying the index construction cost for small reads; - the index and candidate scratch space are released when the data source is closed. The existing object/block zone-map checks remain in place. This changes only candidate selection, not tombstone visibility or deletion semantics. Validation: - `go test ./pkg/vm/engine/disttae -count=1` - `go test -race ./pkg/vm/engine/disttae -run '^TestTombstoneObjectIndex' -count=1` - exhaustive equivalence test over 701 objects and 1,100 block IDs - QA-shape benchmark (700 tombstone objects, 132 data blocks, 5 iterations): - linear scan: about 501 us/op - index build: about 72 us/op, 57,344 B/op, 1 alloc/op - indexed block queries: about 11.8 us/op, 0 B/op - build plus queries is about 6x faster than the linear scan This is intentionally separate from the cgroup pressure handling in matrixorigin#26471. It reduces the work generated by the workload but does not claim to solve all sources of CN memory pressure by itself. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [x] Improvement ## Which issue(s) this PR fixes: Related to matrixorigin#26465 ## What this PR does / why we need it: After matrixorigin#26470 removed the per-object allocation, large table scans still test every visible tombstone object for every data block. The QA workload in matrixorigin#26465 has system tables with roughly 700 visible tombstone objects and scans roughly 132 data blocks per statement, resulting in about 92,000 object-level Rowid zone-map checks per scan. This PR builds a per-data-source interval index from each tombstone object's Rowid zone-map block range: - ranges are sorted by minimum block ID and carry a cumulative maximum; - each data block queries only intervals that can contain its block ID; - candidate objects are restored to the original visible-object order before the existing tombstone reader is called, preserving read and error order; - objects without an initialized Rowid zone map remain unconditional candidates because they cannot be safely excluded; - scans below 32 blocks keep the existing allocation-free linear iterator to avoid paying the index construction cost for small reads; - the index and candidate scratch space are released when the data source is closed. The existing object/block zone-map checks remain in place. This changes only candidate selection, not tombstone visibility or deletion semantics. Validation: - `go test ./pkg/vm/engine/disttae -count=1` - `go test -race ./pkg/vm/engine/disttae -run '^TestTombstoneObjectIndex' -count=1` - exhaustive equivalence test over 701 objects and 1,100 block IDs - QA-shape benchmark (700 tombstone objects, 132 data blocks, 5 iterations): - linear scan: about 501 us/op - index build: about 72 us/op, 57,344 B/op, 1 alloc/op - indexed block queries: about 11.8 us/op, 0 B/op - build plus queries is about 6x faster than the linear scan This is intentionally separate from the cgroup pressure handling in matrixorigin#26471. It reduces the work generated by the workload but does not claim to solve all sources of CN memory pressure by itself. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
Related to #26465
What this PR does / why we need it:
After #26470 removed the per-object allocation, large table scans still test
every visible tombstone object for every data block. The QA workload in #26465
has system tables with roughly 700 visible tombstone objects and scans roughly
132 data blocks per statement, resulting in about 92,000 object-level Rowid
zone-map checks per scan.
This PR builds a per-data-source interval index from each tombstone object's
Rowid zone-map block range:
the existing tombstone reader is called, preserving read and error order;
candidates because they cannot be safely excluded;
avoid paying the index construction cost for small reads;
closed.
The existing object/block zone-map checks remain in place. This changes only
candidate selection, not tombstone visibility or deletion semantics.
Validation:
go test ./pkg/vm/engine/disttae -count=1go test -race ./pkg/vm/engine/disttae -run '^TestTombstoneObjectIndex' -count=1This is intentionally separate from the cgroup pressure handling in #26471.
It reduces the work generated by the workload but does not claim to solve all
sources of CN memory pressure by itself.