explain.depesz.com

PostgreSQL's explain analyze made readable

Result: meca

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 434.883 ↑ 2.0 1 1

Unique (cost=119,817.57..119,817.59 rows=2 width=96) (actual time=434.882..434.883 rows=1 loops=1)

2.          

CTE pair

3. 0.001 434.722 ↑ 2.0 1 1

Unique (cost=119,770.54..119,770.55 rows=2 width=64) (actual time=434.721..434.722 rows=1 loops=1)

4. 0.010 434.721 ↑ 1.0 2 1

Sort (cost=119,770.54..119,770.54 rows=2 width=64) (actual time=434.720..434.721 rows=2 loops=1)

  • Sort Key: d.bo_document_fkey, d.id
  • Sort Method: quicksort Memory: 25kB
5. 0.000 434.711 ↑ 1.0 2 1

Append (cost=0.86..119,770.53 rows=2 width=64) (actual time=0.032..434.711 rows=2 loops=1)

6. 0.003 0.033 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.86..6.91 rows=1 width=19) (actual time=0.031..0.033 rows=1 loops=1)

7. 0.017 0.017 ↑ 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=28) (actual time=0.017..0.017 rows=1 loops=1)

  • Index Cond: ((bo_document_fkey)::text = 'P_1349840'::text)
8. 0.013 0.013 ↑ 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.012..0.013 rows=1 loops=1)

  • Index Cond: (parent_fkey = (d.deal_pair_fkey)::text)
  • Heap Fetches: 0
9. 18.822 447.091 ↑ 1.0 1 1

Gather (cost=1,004.46..119,763.60 rows=1 width=19) (actual time=434.581..447.091 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
10. 257.948 428.269 ↓ 0.0 0 3 / 3

Hash Join (cost=4.46..118,763.50 rows=1 width=19) (actual time=291.392..428.269 rows=0 loops=3)

  • Hash Cond: ((d_1.deal_pair_fkey)::text = (d2_1.parent_fkey)::text)
11. 170.282 170.282 ↑ 1.3 1,278,198 3 / 3

Parallel Seq Scan on bo_contract_hardwood_deal d_1 (cost=0.00..112,767.48 rows=1,597,748 width=28) (actual time=1.618..170.282 rows=1,278,198 loops=3)

12. 0.005 0.039 ↑ 1.0 1 3 / 3

Hash (cost=4.45..4.45 rows=1 width=9) (actual time=0.039..0.039 rows=1 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
13. 0.034 0.034 ↑ 1.0 1 3 / 3

Index Scan using bo_contract_hardwood_deal__bo_document_fkey on bo_contract_hardwood_deal d2_1 (cost=0.43..4.45 rows=1 width=9) (actual time=0.033..0.034 rows=1 loops=3)

  • Index Cond: ((bo_document_fkey)::text = 'P_1349840'::text)
14. 0.009 434.882 ↑ 1.0 2 1

Sort (cost=47.01..47.02 rows=2 width=96) (actual time=434.881..434.882 rows=2 loops=1)

  • Sort Key: bo_contract_hardwood_deal.id, (('party/'::text || (seller.id)::text)), (('deal/'::text || (CASE WHEN ((bo_contract_hardwood_deal_1.is_buyer IS TRUE) AND (pair_base.status = 2)) THEN bo_contract_hardwood_deal_1.id WHEN ((bo_contract_hardwood_deal_1.is_buyer IS FALSE) AND (pair_base.status = 2) AND (base.status <> 2)) THEN bo_contract_hardwood_deal_1.id ELSE bo_contract_hardwood_deal.id END)::text))
  • Sort Method: quicksort Memory: 25kB
15. 0.002 434.873 ↑ 1.0 2 1

Append (cost=2.42..47.00 rows=2 width=96) (actual time=434.813..434.873 rows=2 loops=1)

16. 0.003 434.817 ↑ 1.0 1 1

Nested Loop (cost=2.42..23.63 rows=1 width=73) (actual time=434.813..434.817 rows=1 loops=1)

17. 0.002 434.802 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.98..20.86 rows=1 width=36) (actual time=434.798..434.802 rows=1 loops=1)

18. 0.002 434.792 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.42..17.81 rows=1 width=42) (actual time=434.788..434.792 rows=1 loops=1)

19. 0.002 434.773 ↑ 1.0 1 1

Nested Loop (cost=0.99..15.04 rows=1 width=31) (actual time=434.771..434.773 rows=1 loops=1)

20. 0.006 434.753 ↑ 2.0 1 1

Nested Loop (cost=0.43..8.94 rows=2 width=37) (actual time=434.751..434.753 rows=1 loops=1)

21. 434.724 434.724 ↑ 2.0 1 1

CTE Scan on pair (cost=0.00..0.04 rows=2 width=32) (actual time=434.722..434.724 rows=1 loops=1)

22. 0.023 0.023 ↑ 1.0 1 1

Index Scan using bo_contract_hardwood_deal_pkey on bo_contract_hardwood_deal (cost=0.43..4.45 rows=1 width=37) (actual time=0.023..0.023 rows=1 loops=1)

  • Index Cond: ((id)::text = (pair.deal_id)::text)
  • Filter: actual
23. 0.018 0.018 ↑ 1.0 1 1

Index Only Scan using bo_document_base_id_status_idx on bo_document_base base (cost=0.56..3.05 rows=1 width=14) (actual time=0.017..0.018 rows=1 loops=1)

  • Index Cond: ((id = (bo_contract_hardwood_deal.bo_document_fkey)::text) AND (status = 2))
  • Heap Fetches: 1
24. 0.017 0.017 ↑ 1.0 1 1

Index Scan using bo_contract_hardwood_deal_220_parent_fkey_id on bo_contract_hardwood_deal bo_contract_hardwood_deal_1 (cost=0.43..2.76 rows=1 width=29) (actual time=0.016..0.017 rows=1 loops=1)

  • Index Cond: ((bo_contract_hardwood_deal.deal_pair_fkey)::text = (parent_fkey)::text)
  • Filter: actual
25. 0.008 0.008 ↑ 1.0 1 1

Index Only Scan using bo_document_base_id_status_idx on bo_document_base pair_base (cost=0.56..3.05 rows=1 width=14) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: (id = (bo_contract_hardwood_deal_1.bo_document_fkey)::text)
  • Heap Fetches: 1
26. 0.012 0.012 ↑ 1.0 1 1

Index Only Scan using bo_party_pkey on bo_party seller (cost=0.43..2.76 rows=1 width=10) (actual time=0.012..0.012 rows=1 loops=1)

  • Index Cond: (id = (bo_contract_hardwood_deal.bo_party_seller_fkey)::text)
  • Heap Fetches: 1
27. 0.002 0.054 ↑ 1.0 1 1

Nested Loop (cost=2.42..23.35 rows=1 width=73) (actual time=0.053..0.054 rows=1 loops=1)

28. 0.003 0.046 ↑ 1.0 1 1

Nested Loop (cost=1.98..20.58 rows=1 width=36) (actual time=0.044..0.046 rows=1 loops=1)

29. 0.001 0.036 ↑ 1.0 1 1

Nested Loop (cost=1.42..17.53 rows=1 width=42) (actual time=0.035..0.036 rows=1 loops=1)

30. 0.002 0.027 ↑ 1.0 1 1

Nested Loop (cost=0.86..14.48 rows=1 width=48) (actual time=0.026..0.027 rows=1 loops=1)

31. 0.003 0.019 ↑ 2.0 1 1

Nested Loop (cost=0.43..8.94 rows=2 width=37) (actual time=0.018..0.019 rows=1 loops=1)

32. 0.001 0.001 ↑ 2.0 1 1

CTE Scan on pair pair_1 (cost=0.00..0.04 rows=2 width=32) (actual time=0.001..0.001 rows=1 loops=1)

33. 0.015 0.015 ↑ 1.0 1 1

Index Scan using bo_contract_hardwood_deal_pkey on bo_contract_hardwood_deal bo_contract_hardwood_deal_2 (cost=0.43..4.45 rows=1 width=37) (actual time=0.015..0.015 rows=1 loops=1)

  • Index Cond: ((id)::text = (pair_1.deal_id)::text)
  • Filter: actual
34. 0.006 0.006 ↑ 1.0 1 1

Index Scan using bo_contract_hardwood_deal_220_parent_fkey_id on bo_contract_hardwood_deal bo_contract_hardwood_deal_3 (cost=0.43..2.76 rows=1 width=29) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: ((parent_fkey)::text = (bo_contract_hardwood_deal_2.deal_pair_fkey)::text)
  • Filter: actual
35. 0.008 0.008 ↑ 1.0 1 1

Index Only Scan using bo_document_base_id_status_idx on bo_document_base base_1 (cost=0.56..3.05 rows=1 width=14) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: (id = (bo_contract_hardwood_deal_2.bo_document_fkey)::text)
  • Heap Fetches: 1
36. 0.007 0.007 ↑ 1.0 1 1

Index Only Scan using bo_document_base_id_status_idx on bo_document_base pair_base_1 (cost=0.56..3.05 rows=1 width=14) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: ((id = (bo_contract_hardwood_deal_3.bo_document_fkey)::text) AND (status = 2))
  • Heap Fetches: 1
37. 0.006 0.006 ↑ 1.0 1 1

Index Only Scan using bo_party_pkey on bo_party seller_1 (cost=0.43..2.76 rows=1 width=10) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (id = (bo_contract_hardwood_deal_2.bo_party_seller_fkey)::text)
  • Heap Fetches: 1
Planning time : 140.011 ms
Execution time : 447.463 ms