The statement isn’t executed when using EXPLAIN, only the parsing and planning stages take place.
DQL
DQL
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
🚀 SDK Version 5.0 is now live! See What's New in v5 for details.
DQL language syntax for displaying the execution plan produced by the query planner for a statement.
EXPLAIN SELECT test.* FROM test;
{
"plan": {
"#operator": "sequence",
"children": [
{
"#operator": "scan",
"alias": "test",
"collection": "test",
"datasource": "default",
"descriptor": {
"path": {
"full_scan": {}
}
}
},
{
"#operator": "projection",
"projections": [
{
"expression": "`test`",
"wildcard": true
}
]
}
]
}
}
EXPLAIN
SELECT field3,count(*) the_count
FROM test
WHERE (field1 = 1 AND field2 = 2)
GROUP BY field3
ORDER BY the_count DESC;
{
"plan": {
"#operator": "sequence",
"children": [
{
"#operator": "index_scan",
"alias": "test",
"collection": "test",
"datasource": "default",
"desc": {
"index": "ix_f1",
"spans": [
{
"index_key": {
"direction": "asc",
"include_missing": true,
"key": [
"field1"
]
},
"range": {
"high": {
"included": true,
"value": 1
},
"low": {
"included": true,
"value": 1
}
}
}
]
}
},
{
"#operator": "filter",
"condition": "((`test`.`field1` = 1) AND (`test`.`field2` = 2))"
},
{
"#operator": "groupBy",
"aggregates": [
{
"expr": "true",
"name": "count(true)"
}
],
"keys": [
{
"alias": "$$(group_by_key_1)$$",
"expression": "`test`.`field3`"
}
]
},
{
"#operator": "projection",
"projections": [
{
"alias": "field3",
"expression": ".`$$(group_by_key_1)$$`"
},
{
"alias": "the_count",
"expression": "count(true)"
}
]
},
{
"#operator": "sort",
"orderBy": [
{
"direction": "desc",
"key": ".`$$(projection)$$`.`the_count`"
}
]
},
{
"#operator": "final_projection"
}
]
}
}
Was this page helpful?