explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tAAs

Settings
# exclusive inclusive rows x rows loops node
1. 1,081.471 1,081.471 ↑ 3.0 1 1

CTE Scan on pair (cost=149,522.73..149,522.79 rows=3 width=64) (actual time=1,081.470..1,081.471 rows=1 loops=1)

2.          

CTE deal_with_base_id

3. 0.052 0.052 ↑ 1.0 1 1

Index Scan using bo_contract_hardwood_deal__bo_document_fkey on bo_contract_hardwood_deal d (cost=0.43..4.45 rows=1 width=37) (actual time=0.050..0.052 rows=1 loops=1)

  • Index Cond: ((bo_document_fkey)::text = 'P_1349840'::text)
4.          

CTE pair

5. 0.012 1,081.466 ↑ 3.0 1 1

HashAggregate (cost=149,518.26..149,518.29 rows=3 width=64) (actual time=1,081.466..1,081.466 rows=1 loops=1)

  • Group Key: d_1.id, d_1.deal_id
6. 0.003 1,081.454 ↑ 1.5 2 1

Append (cost=0.43..149,518.24 rows=3 width=64) (actual time=0.107..1,081.454 rows=2 loops=1)

7. 0.006 0.111 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.43..2.48 rows=1 width=64) (actual time=0.106..0.111 rows=1 loops=1)

8. 0.057 0.057 ↑ 1.0 1 1

CTE Scan on deal_with_base_id d_1 (cost=0.00..0.02 rows=1 width=96) (actual time=0.054..0.057 rows=1 loops=1)

9. 0.048 0.048 ↑ 1.0 1 1

Index Only Scan using bo_contract_hardwood_deal_220_parent_fkey_id on bo_contract_hardwood_deal d2 (cost=0.43..2.45 rows=1 width=9) (actual time=0.046..0.048 rows=1 loops=1)

  • Index Cond: (parent_fkey = (d_1.deal_pair_fkey)::text)
  • Heap Fetches: 0
10. 721.161 1,081.340 ↑ 2.0 1 1

Hash Join (cost=0.03..149,515.73 rows=2 width=19) (actual time=82.077..1,081.340 rows=1 loops=1)

  • Hash Cond: ((d_2.deal_pair_fkey)::text = (d2_1.parent_fkey)::text)
11. 360.174 360.174 ↑ 1.0 3,834,595 1

Seq Scan on bo_contract_hardwood_deal d_2 (cost=0.00..135,135.95 rows=3,834,595 width=28) (actual time=0.013..360.174 rows=3,834,595 loops=1)

12. 0.003 0.005 ↑ 1.0 1 1

Hash (cost=0.02..0.02 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
13. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on deal_with_base_id d2_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.001..0.002 rows=1 loops=1)

Planning time : 1.877 ms
Execution time : 1,081.613 ms