Skip to content

[Improvement] Reuse primary-key sorted index after partial source retirement #252

Description

@wangyong9999

Search before asking

  • I searched in the issues and found nothing similar.

Paimon-cpp version

Apache Paimon C++ main at 4027601.

Minimal reproduce step

  1. Create a primary-key table and compact data files A and B into a positive level.
  2. Build a source-backed scalar index payload whose immutable source metadata is [A, B].
  3. Commit an update which retires A, keeps B active with a deletion vector, and adds an uncovered replacement file C. The original payload remains active.
  4. Scan an indexed predicate.

What does not meet expectations?

The reader currently validates a payload only when its complete source list equals the current active source set of the whole level. It therefore rejects [A, B] against active [B, C] and turns both surviving indexed data and the new file into ordinary scans.

The payload still has a valid immutable ordinal namespace for B. The reader should reuse it for the active intersection, preserve the deletion vector on B, and leave only uncovered C on the ordinary scan path. Multiple retained payload groups should be accepted only when their active source intersections are disjoint; ambiguous overlap must continue to fall back.

Anything else?

The fix can remain read-side only: no public API, storage format, or index protocol change is required.

Are you willing to submit a PR?

  • I am willing to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions