[SERVER-70669] Optimize empty encrypted range queries in aggregation Created: 18/Oct/22  Updated: 05/Dec/22  Resolved: 02/Nov/22

Status: Closed
Project: Core Server
Component/s: Queryable Encryption
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Davis Haupt (Inactive) Assignee: Backlog - Query Optimization
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-70969 Generate a single payload for non-ove... Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

The agg expression:

{
    $and: [
        {$lte: ["$age", NumberInt(12)]},
        {$gt: ["$age", NumberInt(15)]},
    ]
}

Currently produces two separate one-sided ranges. This means that lots of work will be done server-side for a query which is known to return no results on the client. Query analysis should optimize this predicate to produce a single encrypted payload that contains no edges.

Note that this optimization is only valid without arrays.


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