Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12964

Allow planCacheListPlans to accept the shape as an object

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • 2.6.0-rc0
    • 2.6.0-rc1
    • Querying, Shell
    • Fully Compatible

    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});

      Attachments

        Activity

          People

            benety.goh@mongodb.com Benety Goh
            benjamin.becker Ben Becker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: