[COMPASS-6995] Projection expressions appear to be ignored in explain in the latest version of Compass Created: 01/Jul/23  Updated: 29/Oct/23  Resolved: 05/Jul/23

Status: Closed
Project: Compass
Component/s: Explain
Affects Version/s: 1.38.2
Fix Version/s: 1.39.0

Type: Bug Priority: Major - P3
Reporter: Rick Houlihan Assignee: Sergey Petushkov
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Windows 10 Pro
node.js / npm versions:
Additional info:


Documentation Changes: Not Needed
Sprint: Iteration Edmontonia

 Description   

Problem Statement/Rationale

Explain output shows no projection even when an expression is defined in the filter options.

Steps to Reproduce

Create a new collection and insert the following documents:
[{   "_id": "P1",   "data": "P1data",   "relatedTo": "P1" }, {   "_id": "P2",   "data": "P2data",   "relatedTo": "P2" }, {   "_id": "C1",   "data": "C1data",   "relatedTo": [     "P1",     "P2"   ] }, {   "_id": "C2",   "data": "C2data",   "relatedTo": [     "P1",     "P2"   ] }]

 

Create a compound index on {relatedTo:1, data:1}

Set the following filter expression in Compass:

{relatedTo:"P1"}

Expand Options and set the following projection expression:
{_id:0, data:1}

Hit explain and examine the raw output.

Expected Results

I would expect the winning plan to be PROJECTION_COVERED and that the projection expression would be shown in the command section of the explain output. 

Actual Results

The index is used, but all documents are fetched since the projection expression is missing in the command section of the explain output.



 Comments   
Comment by Githook User [ 14/Jul/23 ]

Author:

{'name': 'Sergey Petushkov', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: fix(compass-query-bar): map project to projection before emitting open-explain-plan event COMPASS-6995 (#4615)

fix(compass-query-bar): map project to projection before emitting open-explain-plan event
Branch: ga-releases
https://github.com/mongodb-js/compass/commit/9c1e839a379c1d7525de44084db049cc54c0b292

Comment by Githook User [ 11/Jul/23 ]

Author:

{'name': 'Sergey Petushkov', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: fix(compass-query-bar): map project to projection before emitting open-explain-plan event COMPASS-6995 (#4615)

fix(compass-query-bar): map project to projection before emitting open-explain-plan event
Branch: storage-mixin-from-user-preferences
https://github.com/mongodb-js/compass/commit/9c1e839a379c1d7525de44084db049cc54c0b292

Comment by Githook User [ 10/Jul/23 ]

Author:

{'name': 'Sergey Petushkov', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: fix(compass-query-bar): map project to projection before emitting open-explain-plan event COMPASS-6995 (#4615)

fix(compass-query-bar): map project to projection before emitting open-explain-plan event
Branch: beta-releases
https://github.com/mongodb-js/compass/commit/9c1e839a379c1d7525de44084db049cc54c0b292

Comment by Githook User [ 05/Jul/23 ]

Author:

{'name': 'Sergey Petushkov', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: fix(compass-query-bar): map project to projection before emitting open-explain-plan event COMPASS-6995 (#4615)

fix(compass-query-bar): map project to projection before emitting open-explain-plan event
Branch: COMPASS-6979-pass-schema-and-docs-to-ai
https://github.com/mongodb-js/compass/commit/9c1e839a379c1d7525de44084db049cc54c0b292

Comment by Sergey Petushkov [ 05/Jul/23 ]

Thanks for the report rick.houlihan@mongodb.com! Should be fixed in the next Compass release

Comment by Githook User [ 05/Jul/23 ]

Author:

{'name': 'Sergey Petushkov', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: fix(compass-query-bar): map project to projection before emitting open-explain-plan event COMPASS-6995 (#4615)

fix(compass-query-bar): map project to projection before emitting open-explain-plan event
Branch: main
https://github.com/mongodb-js/compass/commit/9c1e839a379c1d7525de44084db049cc54c0b292

Generated at Wed Feb 07 22:44:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.