[SERVER-28116] Consider creating an index filter parameter which modifies how queries are matched Created: 27/Feb/17  Updated: 06/Dec/22

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

Type: New Feature Priority: Major - P3
Reporter: Chris Harris Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: storch
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-17182 Planner ignores index filter and uses... Closed
Assigned Teams:
Query Optimization
Participants:
Case:

 Description   

The current implementation of index filters allows for granular control as they are set and matched against the full query shape:

Index filters determine which indexes the optimizer evaluates for a query shape. A query shape consists of a combination of query, sort, and projection specifications. If an index filter exists for a given query shape, the optimizer only considers those indexes specified in the filter.

This is very nice as it allows for quite a bit of flexibility. However, this matching pattern does not work well for all use cases. Consider an application that allows the customer to dynamically select projections. If index filters are needed in that environment, then it may not be feasible to try to determine and manage them based on the modifiable projections.

While the default matching level should remain the same, we could consider introducing a tunable parameter for relaxing it. Using the example above, the option could be set to a mode that instructs the optimizer to only consider the query predicates and sort fields (eg: not consider projections) when checking for matches against index filters.


Generated at Thu Feb 08 04:17:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.