Database Reference
In-Depth Information
EXPLAIN VERBOSE
Now, we will dig more into EXPLAIN with EXPLAIN VERBOSE . The following is an
example of EXPLAIN VERBOSE :
warehouse_db=# EXPLAIN VERBOSE SELECT * FROM record.history;
QUERY PLAN
------------------------------------------------------------------
Seq Scan on record.history (cost=0.00..1934580.00 rows=100000000
width=46)
Output: history_id, date, amount, data, customer_id,
warehouse_id
Planning time: 0.093 ms
(3 rows)
EXPLAIN pretty formats
There is a wonderful option from where we can get a more readable output from
EXPLAIN . The formatted output can be easily parsed by programs. Formatted output
can be in TEXT, XML, JSON, or YAML.
Here is an example of a formatted output in JSON:
warehouse_db=# EXPLAIN (FORMAT JSON) SELECT * FROM record.history;
QUERY PLAN
-----------------------------------
[ +
{ +
"Plan": { +
"Node Type": "Seq Scan", +
"Relation Name": "history",+
"Alias": "history", +
"Startup Cost": 0.00, +
"Total Cost": 1934580.00, +
"Plan Rows": 100000000, +
"Plan Width": 46 +
}, +
"Planning Time": 0.101 +
} +
]
(2 rows)
 
Search WWH ::




Custom Search