[SERVER-76591] Move custom limit pushdown for search queries to generic sharded agg limit pushdown Created: 27/Apr/23  Updated: 05/Feb/24

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Backlog - Query Integration
Resolution: Unresolved Votes: 0
Labels: neweng, qi-search, quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-81083 Remove legacy 'limit' parsing support... Open
Assigned Teams:
Query Integration
Participants:

 Description   

There is a custom optimization for $search where we try to extract a limit for pushdown to the shards (similar for the $idLookup stage). This was put in place most likely because the generic limit pushdown was not triggering for search queries after the sharded facets project. Upon closer inspection, it seems possible that changing the stage constraints for $setVariableFromSubPipeline (added for sharded facets) to allow swapping with limit will enable the generic pushdown.

Also worth noting that as of SERVER-72934, we only create the $setVariableFromSubPipeline stage if there's a reference to SEARCH_META, so we should test both scenarios.


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