[SERVER-83442] Reorder predicates in a Filter node based on selectivity Created: 20/Nov/23  Updated: 23/Jan/24

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Anton Korshunov Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: M7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-83441 Pushdown top-level fields from Filter... Closed
depends on SERVER-83839 Implement query-knob guarded logic to... Closed
is depended on by SERVER-83456 Skip Filter->Sargable rewrite for col... Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

When the most selective conditions in a conjunction are evaluated first, this reduces the likelihood that the subsequent conditions will need to be evaluated at all due to Boolean short-circuit logic. Therefore it is beneficial to order the terms of a conjunction according to their selectivity. This ordering assumes that all terms have approximately equal cost, which is true for all range comparison operations. When some day we will consider expensive predicates the ordering should be done based on the ratio of selectivity and cost (or rank).

Since predicate order is a physical property, and cost is a physical property as well, this reordering should be done during the implementation phase, when logical nodes are implemented via specific physical nodes.

Currently this reordering is performed during the implementation of SargableNode, via the call to function lowerPartialSchemaRequirements().


Generated at Thu Feb 08 06:52:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.