Skip to content

[P2] Add Query Plan / Explain functionality #106

@sajeetharan

Description

@sajeetharan

Feature Request

Priority: P2 (Medium)

Description

CosmosDB Shell shows query metrics and RU cost but does not provide query plan visualization or explain functionality. Understanding how queries are executed helps developers optimize performance.

Comparable Features in Other Shells

  • mongosh: cursor.explain(), PlanCache methods
  • sqlcmd: Execution plans via SET SHOWPLAN

Proposed Behavior

Add an explain command or --explain flag:

  • Show query execution plan
  • Display index utilization details
  • Show which indexes were used vs. scanned
  • Indicate full scan vs. index seek

Example Usage

query "SELECT * FROM c WHERE c.city = 'Seattle'" --explain
explain "SELECT * FROM c WHERE c.status = 'active'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions