Consider the following query:
SELECT *
FROM Table1
INNER JOIN Table2 ON Condition1
INNER JOIN Table3 ON Condition2
INNER JOIN Table4 ON Condition3
INNER JOIN Table5 ON Condition4;
Is there a way to know which join takes more time when executing this query?
CodePudding user response:
You can use EXPLAIN (ANALYZE) /* your query */
to find out such details. Look at the actual time
, but consider than the results are cumulative, that is, you have to subtract the time from the lower nodes to get the net time of a node.
You can use https://explain.depesz.com for such an execution plan, that will calculate the net time for each step for you.