Skip to content

[Bug]: Partition-state filtering does not apply composite-key prefix open ranges #25595

Closed

Description

@XuPeng-SH

Is there an existing issue for this?

  • I have searched the existing issues.

Branch Name

main

Commit ID

7821d21

Other Environment Information

N/A

Actual Behavior

Composite-primary-key predicate rewriting can produce prefix open-range filters such as (prefix, value), (prefix, +∞), (-∞, prefix), and closed/open variants. The partition-state in-memory filter and primary-key iterator do not represent all of these forms. They therefore fall back to scanning workspace/partition rows instead of filtering and terminating the iterator by primary-key bounds.

Results remain correct after residual filtering, but selective workspace queries lose expected early pruning and can become unnecessarily expensive.

Expected Behavior

Partition-state filtering and the primary-key iterator should support all composite-key prefix range forms, apply them to workspace rows, and stop iteration as soon as an upper bound proves that no later key can match.

Steps to Reproduce

  1. Create a table with a composite primary key (c1, c2) and workspace/partition-state rows.
  2. Query a selective predicate such as c1 = 5 AND c2 > 3, or the corresponding left/right/open/closed range variants.
  3. Inspect the partition-state path: the predicate is not represented as an in-memory PK filter and rows are scanned rather than pruned by range bounds.

Additional information

The fix adds prefix open-range support to the in-memory filter and iterator, includes workspace filtering and upper-bound early termination, and covers all boundary inclusivity combinations.

Activity

  1. added this to the MO-202607 milestone on Jul 11, 2026
  2. self-assigned this
    on Jul 11, 2026
  3. added
    kind/bug
    severity/s0
    and removed on Jul 11, 2026
  4. added theissue type on Jul 11, 2026
  5. added a commit that references this issue on Jul 12, 2026
    de64386
  6. XuPeng-SH commented on Jul 12, 2026

    @XuPeng-SH
    ContributorAuthor
  7. Ariznawlll commented on Jul 13, 2026

    @Ariznawlll
    Collaborator

    已在最新 main@2865ed6cc8a39727b8b274bb52b88fe441d0b30c 验证通过。

    • 对应修复:de6438665 / fix: strengthen filter pushdown and PK pruning #25596。
    • 这里验证的是 DN/disttae 的 partition-state 内存 PK iterator,不是 SQL partition table 行为。
    • TestPrefixBetweenOpenBounds 覆盖左右 open/closed 和 prefix 边界;TestPrefixBetweenStopsAtDeletedEntryPastUpperBound 覆盖越过 upper bound 且中间存在 deleted entry 的提前终止。
    • 两项使用 -race -count=5 通过。

    复合键 prefix open range 已能正确下推和提前停止,修复有效。

  8. added 3 commits that reference this issue on Sep 17, 2026
    69cf9ab
    00f3b8c
    59220c3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions