[SERVER-17854] Allow $or predicates to be indexed by partial indexes Created: 01/Apr/15  Updated: 05/Feb/16  Resolved: 23/Jun/15

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

Type: Improvement Priority: Major - P3
Reporter: J Rassi Assignee: J Rassi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-18092 Convert index_partial2.js test to que... Closed
Related
related to SERVER-19511 Distinct command with no predicate ca... Closed
Backwards Compatibility: Fully Compatible
Sprint: Quint Iteration 3.1.2, Quint Iteration 3, Quint Iteration 4, Quint Iteration 5
Participants:

 Description   

The 3.1.1 version of partial indexes decides if a given query is compatible with a given partial index by checking if the query's root predicate describes a subset of the documents that the partial index document filter describes. However, this does not allow $or predicates to be indexed by partial indexes, as $or predicates are indexed by a union of scans on separate indexes.

This would allow the following query to be answerable by a union of scans on the following two indexes:

  • query: find({$or: [{a: 1, f: true}, {b: 1}]})
  • index #1: key pattern {a: 1}, partial index document filter {f: true}
  • index #2: key pattern {b: 1}


 Comments   
Comment by Githook User [ 23/Jun/15 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-17854 Move partial idx selection logic to QueryPlannerIXSelect

Also replaces index_partial_queryplanner.js with unit test
query_planner_partialidx_test.cpp.
Branch: master
https://github.com/mongodb/mongo/commit/f9311e512c9150280d26f0840cbe94a31c9b5a19

Generated at Thu Feb 08 03:45:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.