[SERVER-35337] Implement/test existence and null comparison queries using "allPaths" indexes Created: 01/Jun/18  Updated: 29/Oct/23  Resolved: 24/Aug/18

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

Type: Task Priority: Major - P3
Reporter: David Storch Assignee: Ian Boros
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-35330 Enhance query planner's index selecti... Closed
depends on SERVER-35500 Extend IndexBoundsBuilder to implemen... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2018-08-13, Query 2018-08-27, Query 2018-09-10
Participants:

 Description   

"allPaths" indexes have a sparseness property by default, so the planning behavior is special for $exists:true, $exists:false, $eq:null, $ne:null, etc.



 Comments   
Comment by Githook User [ 24/Aug/18 ]

Author:

{'name': 'samontea', 'email': 'merciers.merciers@gmail.com', 'username': 'samontea'}

Message: SERVER-35337 Implement/test existence and null comparison queries using "allPaths" indexes
Branch: master
https://github.com/mongodb/mongo/commit/6937c4f829d3cd1f24745c98bb47f16fa4d8de28

Comment by James Wahlin [ 31/Jul/18 ]

After further discussion, it looks like we could support null and existence queries using an "allPaths" index, given we generate keys for empty objects and empty top level arrays. These keys would be used for existence checks only, as we will continue to store leaf nodes for objects rather than than whole objects when non-empty.

Comment by Ian Boros [ 30/Jul/18 ]

As part of this ticket we should talk to Asya and be sure she's okay with not supporting this behavior.

Comment by James Wahlin [ 30/Jul/18 ]

It is likely that "allPaths" indexes will not be able to support $exists queries. As it stands, we will not create an index entry for an object such as: { a: {} }, but existence or non-existence of such an object will impact the result of an existence query.

Queries on equality to null will be similarly impacted as null can match on either an existing field with a null value or a missing field.

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