[SERVER-68310] [CQF] {a: {$gte: MinKey()}} hits assertion in Cascades Created: 26/Jul/22  Updated: 29/Oct/23  Resolved: 27/Jul/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Ben Shteinfeld Assignee: Ben Shteinfeld
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-67624 [CQF] Fix ABT translations for match ... Closed
Backwards Compatibility: Fully Compatible
Sprint: QO 2022-08-08
Participants:

 Description   

After https://jira.mongodb.org/browse/SERVER-67782, the server now hits this assertion when attempting to optimize the following query: `{a: {$gte: MinKey()}}` or `{a: {$lte: MaxKey()}}`.

The assertion maintains the invariant that every PartialSchemaRequirement either has an output binding or is not fully open (constraints the input field in some way). In the aforementioned queries, they have neither: filters have no output binding and the intervals are fully open. This PartialSchemaRequirement is not useful because it is a no-op.

After a discussion with svilen.mihaylov@mongodb.com, we decided keeping this invariant is useful in order to reduce the Cascades search space. This ticket tracks work to prune fully open PartialSchemaRequirements and avoid creating Sargeable nodes for them.



 Comments   
Comment by Githook User [ 27/Jul/22 ]

Author:

{'name': 'Ben Shteinfeld', 'email': 'ben.shteinfeld@mongodb.com', 'username': 'bshteinfeld'}

Message: SERVER-68310 Filter out PartialSchemaRequirements which are unconstrained and avoid generating SargableNodes for nodes with empty PartialSchemaRequirements
Branch: master
https://github.com/mongodb/mongo/commit/ded3208f1b21529a5bee4d322c1d16d858864587

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