Skip to content

[Tech Request]: pushdown block filter for each filter condition of the composite key #21740

Closed

Description

@XuPeng-SH

Is there an existing issue for the same tech request?

  • I have checked the existing issues.

Does this tech request not affect user experience?

  • This tech request doesn't affect user experience.

What would you like to be added ?

pushdown block filter for each filter condition of the composite key to avoid long prefix in the composite key.

Why is this needed ?

#17367

Additional information

No response

Activity

  1. added
    kind/tech-request
    on Apr 22, 2025
  2. added
    priority/p0
    on Apr 22, 2025
  3. added this to the 2.2.0 milestone on Apr 22, 2025
  4. XuPeng-SH commented on Apr 24, 2025

    @XuPeng-SH
    ContributorAuthor

    if the composite key is columnA and columnB and the filter condition like columnA=? and columnB=?, it is better to push down the block filter composite_key = ? and columnA=? and columnB=?

  5. modified the milestones: 2.2.0, 2506 on Apr 27, 2025
  6. changed the issue type fromtoon May 14, 2025
  7. modified the milestones: MO-2506, MO-2505 on May 14, 2025
  8. fengttt commented on May 20, 2025

    @fengttt
    Contributor

    Worked around by rewriting between to <= and >=

  9. modified the milestones: MO-2506, MO-2508 on Jul 17, 2025
  10. modified the milestones: MO-2508, MO-202602 on Feb 3, 2026
  11. aptend commented on Jul 23, 2026

    @aptend
    Contributor

    Closing this as implemented on current main.

    The core request was to retain block filters for each constituent column of a composite primary/cluster key in addition to the generated hidden compound-key filter. This was implemented by #25596:

    • collectCompositePartBlockFilters preserves zonemappable predicates on the physical key columns before compound-key rewriting.
    • mergeFiltersOnCompositeKey generates the hidden compound-key predicate.
    • retainConsumedCompositePartBlockFilters, appendCompoundKeyBlockFilters, and appendCompositePartBlockFilters keep both forms in BlockFilterList through statistics recalculation and repeated optimization.

    The planner regression TestCompositeKeyPushesCompoundAndPartBlockFilters verifies that a predicate such as a = 1 AND b > 2 AND b < 4 produces the hidden compound in_range filter together with the constituent a =, b >, and b < block filters. The optimizer BVT also verifies plans containing both prefix_eq(__mo_cbkey...) and the original constituent-column condition.

    #25853 subsequently closed the related conservative fallback gaps for OR/disjunct filters, large PREFIX_IN, and mixed compilable/non-compilable range filters. Both changes are present on current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/tech-requestpriority/p0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions