Light
Dark
System
v4latest
v4latest
v3
v2
v1

edgedb analyze

This CLI feature is compatible with EdgeDB server 3.0 and above.

Performance analysis is also available in our CLI REPL and the UI’s REPL and query builder (both accessible by running edgedb ui to invoke your instance’s UI). Use it by prepending your query with analyze.

Run a query performance analysis on the given query.

edgedb analyze [options] query

An example of analyze output from a simple query:

──────────────────────────────────────── Query ────────────────────────────────────────
analyze select ➊  Hero {name, secret_identity, ➋  villains: {name, ➌  nemesis: {name}}};

──────────────────────── Coarse-grained Query Plan ────────────────────────
                   │ Time     Cost Loops Rows Width │ Relations
➊ root            │  0.0 69709.48   1.0  0.0    32 │ Hero
╰──➋ .villains    │  0.0     92.9   0.0  0.0    32 │ Villain, Hero.villains
╰──➌ .nemesis     │  0.0     8.18   0.0  0.0    32 │ Hero

The analyze command runs on the database it is connected to. For specifying the connection target see connection options.

query

The query to analyze. Be sure to wrap the query in quotes.

--expand

Print expanded output of the query analysis

--debug-output-file debug_output_file

Write analysis into the JSON file specified instead of formatting

--read-json read_json

Read JSON file instead of executing a query

Light
Dark
System

We use ChatGPT with additional context from our documentation to answer your questions. Not all answers will be accurate. Please join our Discord if you need more help.