You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Tech Request]: pushdown block filter for each filter condition of the composite key #21740
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=?
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.
Activity
XuPeng-SH commentedon Apr 24, 2025
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=?
fengttt commentedon May 20, 2025
Worked around by rewriting between to <= and >=
aptend commentedon Jul 23, 2026
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:
collectCompositePartBlockFilterspreserves zonemappable predicates on the physical key columns before compound-key rewriting.mergeFiltersOnCompositeKeygenerates the hidden compound-key predicate.retainConsumedCompositePartBlockFilters,appendCompoundKeyBlockFilters, andappendCompositePartBlockFilterskeep both forms inBlockFilterListthrough statistics recalculation and repeated optimization.The planner regression
TestCompositeKeyPushesCompoundAndPartBlockFiltersverifies that a predicate such asa = 1 AND b > 2 AND b < 4produces the hidden compoundin_rangefilter together with the constituenta =,b >, andb <block filters. The optimizer BVT also verifies plans containing bothprefix_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 currentmain.