Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
EXPLAIN FORMAT=JSON should print information about the costs.
ANALYZE FORMAT=JSON should have it,too. Ideally, one should be able to compare r_total_time_ms with the cost and see the discrepancy.
And this should work for every node in the query plan.
Obstacles on the way to implementing this vision:
- For some kinds of subqueries, we do not know how many times they will be executed. We optimize as if the subquery is to be executed once.
- We don't compute the total cost of some constructs e.g. the cost of UNION [ALL] being cost of its members plus cost of the union operation.
So, starting small:
At least, print the cost of computing the SELECT. For selects with r_loops=1 (e.g. for the top-level one), one will be able to compare it with r_total_time_ms.
Also, print total cost of reading each table.