[SERVER-42197] Expose a per-query flag to disable agg optimizations Created: 12/Jul/19  Updated: 06/Dec/22  Resolved: 31/Jul/19

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: David Storch Assignee: Backlog - Query Team (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-38585 Add no-op delimiter stage to aggregat... Backlog
Related
is related to SERVER-38585 Add no-op delimiter stage to aggregat... Backlog
is related to SERVER-35891 Add failpoint to disable aggregation ... Closed
Assigned Teams:
Query
Participants:

 Description   

This would be similar to the failpoint implemented in SERVER-35891, but would be for consumption by users rather than for internal testing purposes. On any given aggregate command, the application could specify a hint to disable optimization of the aggregate pipeline:

db.collection.aggregate([<pipeline>], {disablePipelineOptimizations: true})

Internally, this would work like the failpoint from SERVER-35891 and would convert Pipeline::optimizePipeline() into a no-op. The effect would to be to prevent rewrite optimizations like $match pushdown and $sort-$limit coalescing into a top-k sort. It would serve as an "escape hatch" in the cases where an optimization is actually unhelpful, putting customers into a mode where their pipeline is much closer to procedural code than a logical statement of the query.



 Comments   
Comment by Craig Homa [ 31/Jul/19 ]

Closing as a duplicate of SERVER-38585. Please follow that issue for updates.

Comment by Asya Kamsky [ 22/Jul/19 ]

I would be concerned about a disable that's pipeline wide, given that there is no way for the user to write some of the optimizations literally into their pipeline.

Comment by David Storch [ 12/Jul/19 ]

charlie.swanson, oh yeah, forgot about that one. You're right that this has the same goal as SERVER-38585, but they suggest a slightly different solution. Chris suggests the (arguably better) more granular option of placing a "disable optimization" hint in the pipeline itself. This switch would disable optimization for the operation as a whole. It might still make sense to consider them duplicates, though. We can discuss at our triage meeting.

Comment by Charlie Swanson [ 12/Jul/19 ]

david.storch potential duplicate of SERVER-38585?

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