explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mfM1

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.264 ↑ 2.0 1 1

Unique (cost=62.87..62.89 rows=2 width=96) (actual time=0.262..0.264 rows=1 loops=1)

2.          

CTE pair

3. 0.002 0.082 ↑ 2.0 1 1

Unique (cost=15.84..15.85 rows=2 width=64) (actual time=0.080..0.082 rows=1 loops=1)

4. 0.008 0.080 ↑ 1.0 2 1

Sort (cost=15.84..15.84 rows=2 width=64) (actual time=0.080..0.080 rows=2 loops=1)

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

Append (cost=0.86..15.83 rows=2 width=64) (actual time=0.045..0.072 rows=2 loops=1)

6. 0.003 0.046 ↑ 1.0 1 1

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

7. 0.019 0.019 ↑ 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.019..0.019 rows=1 loops=1)

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

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

Nested Loop (cost=0.86..8.90 rows=1 width=19) (actual time=0.024..0.025 rows=1 loops=1)

10. 0.011 0.011 ↑ 1.0 1 1

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.011..0.011 rows=1 loops=1)

  • Index Cond: ((bo_document_fkey)::text = 'P_1349840'::text)
11. 0.011 0.011 ↑ 1.0 1 1

Index Scan using bo_contract_hardwood_deal_220_parent_fkey_id on bo_contract_hardwood_deal d_1 (cost=0.43..4.45 rows=1 width=28) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: ((parent_fkey)::text = (d2_1.deal_pair_fkey)::text)
12. 0.009 0.262 ↑ 1.0 2 1

Sort (cost=47.01..47.02 rows=2 width=96) (actual time=0.262..0.262 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
13. 0.001 0.253 ↑ 1.0 2 1

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

14. 0.004 0.177 ↑ 1.0 1 1

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

15. 0.000 0.156 ↑ 1.0 1 1

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

16. 0.002 0.143 ↑ 1.0 1 1

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

17. 0.001 0.129 ↑ 1.0 1 1

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

18. 0.002 0.105 ↑ 2.0 1 1

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

19. 0.084 0.084 ↑ 2.0 1 1

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

20. 0.019 0.019 ↑ 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.019..0.019 rows=1 loops=1)

  • Index Cond: ((id)::text = (pair.deal_id)::text)
  • Filter: actual
21. 0.023 0.023 ↑ 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.023..0.023 rows=1 loops=1)

  • Index Cond: ((id = (bo_contract_hardwood_deal.bo_document_fkey)::text) AND (status = 2))
  • Heap Fetches: 1
22. 0.012 0.012 ↑ 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.011..0.012 rows=1 loops=1)

  • Index Cond: ((bo_contract_hardwood_deal.deal_pair_fkey)::text = (parent_fkey)::text)
  • Filter: actual
23. 0.013 0.013 ↑ 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.013..0.013 rows=1 loops=1)

  • Index Cond: (id = (bo_contract_hardwood_deal_1.bo_document_fkey)::text)
  • Heap Fetches: 1
24. 0.017 0.017 ↑ 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.017..0.017 rows=1 loops=1)

  • Index Cond: (id = (bo_contract_hardwood_deal.bo_party_seller_fkey)::text)
  • Heap Fetches: 1
25. 0.003 0.075 ↑ 1.0 1 1

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

26. 0.002 0.060 ↑ 1.0 1 1

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

27. 0.002 0.044 ↑ 1.0 1 1

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

28. 0.002 0.028 ↑ 1.0 1 1

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

29. 0.001 0.014 ↑ 2.0 1 1

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

30. 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.000..0.001 rows=1 loops=1)

31. 0.012 0.012 ↑ 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.012..0.012 rows=1 loops=1)

  • Index Cond: ((id)::text = (pair_1.deal_id)::text)
  • Filter: actual
32. 0.012 0.012 ↑ 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.012..0.012 rows=1 loops=1)

  • Index Cond: ((parent_fkey)::text = (bo_contract_hardwood_deal_2.deal_pair_fkey)::text)
  • Filter: actual
33. 0.014 0.014 ↑ 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.014..0.014 rows=1 loops=1)

  • Index Cond: (id = (bo_contract_hardwood_deal_2.bo_document_fkey)::text)
  • Heap Fetches: 1
34. 0.014 0.014 ↑ 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.014..0.014 rows=1 loops=1)

  • Index Cond: ((id = (bo_contract_hardwood_deal_3.bo_document_fkey)::text) AND (status = 2))
  • Heap Fetches: 1
35. 0.012 0.012 ↑ 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.012..0.012 rows=1 loops=1)

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