[SERVER-76761] [CQF] Investigate lowerEqPrefixes being called for Sargable [Seek] Created: 02/May/23  Updated: 29/Oct/23  Resolved: 22/Aug/23

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

Type: Task Priority: Major - P3
Reporter: David Percy Assignee: Ruoxin Xu
Resolution: Fixed Votes: 0
Labels: auto-reverted
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Related
related to SERVER-78090 [CQF] Avoid computing candidate index... Backlog
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Sprint: QO 2023-08-07, QO 2023-08-21, QO 2023-09-04
Participants:
Linked BF Score: 168

 Description   

When I run recursive_ix_nav.js and log this call to lowerEqPrefixes, specifically the value of const ABT& n, I see Sargable [Seek] nodes being logged. This seems wrong because lowerEqPrefixes is responsible for creating IndexScan stages, or more generally the NLJ / distinct scan / IndexScan pattern we use for recursive index navigation.

------

Also, this Sargable [Seek] node has a nonempty candidateIndexes field. I believe we always populate this field, even though we will end up ignoring it when the target is Seek. Instead we should probably leave it empty in the Seek case. That could both avoid the unnecessary work to populate it, and also prevent us from calling lowerEqPrefixes unnecessarily.

This seems related to SERVER-78090.



 Comments   
Comment by Githook User [ 22/Aug/23 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-76761 Move AttemptCoveringQuery rewrite to the implementer
Branch: master
https://github.com/mongodb/mongo/commit/84548114a0eb0e0debac104d5caa0d3c063fab4f

Comment by xgen-buildbaron-user [ 07/Aug/23 ]

Ticket re-opened due to revert. run_unittests began a consistent failure of build/install/bin/query_cost_model_test,build/install/bin/optimizer_test

Comment by Githook User [ 07/Aug/23 ]

Author:

{'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com', 'username': ''}

Message: Revert "SERVER-76761 Move AttemptCoveringQuery rewrite to the implementer"

This reverts commit cbb3da8712c62f995fc7ffd1ea33198399ffba79.
Branch: master
https://github.com/mongodb/mongo/commit/aa801ab622802586951afd5c2cf71e916267c0aa

Comment by Githook User [ 07/Aug/23 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-76761 Move AttemptCoveringQuery rewrite to the implementer
Branch: minh.luu-no_compile_sys-perf
https://github.com/mongodb/mongo/commit/cbb3da8712c62f995fc7ffd1ea33198399ffba79

Comment by Githook User [ 06/Aug/23 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-76761 Move AttemptCoveringQuery rewrite to the implementer
Branch: master
https://github.com/mongodb/mongo/commit/cbb3da8712c62f995fc7ffd1ea33198399ffba79

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