[SERVER-12964] Allow planCacheListPlans to accept the shape as an object Created: 28/Feb/14  Updated: 11/Jul/16  Resolved: 05/Mar/14

Status: Closed
Project: Core Server
Component/s: Querying, Shell
Affects Version/s: 2.6.0-rc0
Fix Version/s: 2.6.0-rc1

Type: Improvement Priority: Minor - P4
Reporter: Ben Becker Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Participants:

 Description   

The planCacheListPlans command is useful for displaying cached candidate plans for a given query shape, which is specified by query, sort and projection parameters. However, the query shape will often be collected from the planCacheListQueryShapes command, which returns an array of objects. This makes it difficult to pass the results directly to planCacheListPlans (although they can be copy/pasted).

Currently, the workflow may look something like this:

db.runCommand({planCacheListQueryShapes:'collectionName'});
... <copy the fields of the shape object> ...
db.runCommand({planCacheListQueryShapes:'collectionName', <paste the shape object fields>});

or

var shape = db.runCommand({planCacheListQueryShapes:'collectionName'}).shapes[0];
db.runCommand({planCacheListPlans:'collectionName', query: shape.query, sort: shape.sort, projection: shape.projection});

To simplify automation and usability, it would be helpful to allow planCacheListQueryShapes to accept an object with query/sort/projection fields instead of individual parameters; e.g.:

var shape = db.runCommand({planCacheListQueryShapes:'collectionName'}).shapes[0];
db.runCommand({planCacheListQueryShapes:'collectionName', shape});



 Comments   
Comment by Githook User [ 05/Mar/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12964 updated plan cache and index filter commands to return empty results on non-existent collection or query shape
Branch: master
https://github.com/mongodb/mongo/commit/34bd3d0dd8e9c341a2f5f228cde741771af7ed25

Comment by Githook User [ 05/Mar/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12964 accept query shape object in plan cache shell helpers
Branch: master
https://github.com/mongodb/mongo/commit/1655fff18e64179ef4e36565f25b6c06e6b453a9

Generated at Thu Feb 08 03:30:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.