Is your feature request related to a problem?
In most SQL databases, there are actually two flavors of explanation: EXPLAIN and EXPLAIN ANALYZE.
Explain:
EXPLAIN SELECT *
FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2
ORDER BY t1.fivethous;
QUERY PLAN
------------------------------------------------------------------------------------------------
Sort (cost=717.34..717.59 rows=101 width=488)
Sort Key: t1.fivethous
Sort Method: quicksort Memory: 77kB
-> Hash Join (cost=230.47..713.98 rows=101 width=488)
Hash Cond: (t2.unique2 = t1.unique2)
-> Seq Scan on tenk2 t2 (cost=0.00..445.00 rows=10000 width=244)
-> Hash (cost=229.20..229.20 rows=101 width=244)
Buckets: 1024 Batches: 1 Memory Usage: 28kB
-> Bitmap Heap Scan on tenk1 t1 (cost=5.07..229.20 rows=101 width=244)
Recheck Cond: (unique1 < 100)
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=101 width=0)
Index Cond: (unique1 < 100)
Analyze:
EXPLAIN ANALYZE SELECT *
FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2
ORDER BY t1.fivethous;
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------
Sort (cost=717.34..717.59 rows=101 width=488) (actual time=7.761..7.774 rows=100 loops=1)
Sort Key: t1.fivethous
Sort Method: quicksort Memory: 77kB
-> Hash Join (cost=230.47..713.98 rows=101 width=488) (actual time=0.711..7.427 rows=100 loops=1)
Hash Cond: (t2.unique2 = t1.unique2)
-> Seq Scan on tenk2 t2 (cost=0.00..445.00 rows=10000 width=244) (actual time=0.007..2.583 rows=10000 loops=1)
-> Hash (cost=229.20..229.20 rows=101 width=244) (actual time=0.659..0.659 rows=100 loops=1)
Buckets: 1024 Batches: 1 Memory Usage: 28kB
-> Bitmap Heap Scan on tenk1 t1 (cost=5.07..229.20 rows=101 width=244) (actual time=0.080..0.526 rows=100 loops=1)
Recheck Cond: (unique1 < 100)
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=101 width=0) (actual time=0.049..0.049 rows=100 loops=1)
Index Cond: (unique1 < 100)
Planning time: 0.194 ms
Execution time: 8.008 ms
The difference is that ANALYZE also provides actual timings and row results at each stage, making it possible to benchmark the internals of queries without needing to set up an external profiler.
What solution would you like?
The ability to analyze queries in explanation.
What alternatives have you considered?
Keep using external profilers. (Generally necessary for larger-scale throughput benchmarking anyway, but for smaller cases, individually queries can be debugged.)
Do you have any additional context?
N/A
Is your feature request related to a problem?
In most SQL databases, there are actually two flavors of explanation:
EXPLAINandEXPLAIN ANALYZE.Explain:
Analyze:
The difference is that
ANALYZEalso provides actual timings and row results at each stage, making it possible to benchmark the internals of queries without needing to set up an external profiler.What solution would you like?
The ability to analyze queries in explanation.
What alternatives have you considered?
Keep using external profilers. (Generally necessary for larger-scale throughput benchmarking anyway, but for smaller cases, individually queries can be debugged.)
Do you have any additional context?
N/A