Ask with SQL · stop 2 of 5
explain_query
Shows how Postgres plans to run a query, without running it.
Works in read modeTool sets: query · full
You might ask
“Will this query use the index on created_at?”
Your assistant may call explain_query to answer.
How it works
- Runs plain
EXPLAIN, so nothing executes. For timings, usedeep_plan_analysis.
Parameters
sqlstringrequired- A single SELECT or WITH statement to explain (not executed).
connectionIdstring- Optional connection profile override — does not change session context.
databasestring- Database to use instead of the current one, on connectionId or the active connection.
What your assistant reads
The description nexql-mcp sends with the tool. It's how the assistant decides when to use it.
Run EXPLAIN (no ANALYZE execute) for a SELECT/WITH query.