explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SyIn

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 2,122.906 ↑ 6.1 65 1

Finalize GroupAggregate (cost=360,936.29..361,063.69 rows=394 width=197) (actual time=2,122.443..2,122.906 rows=65 loops=1)

  • Group Key: deal_row.code
2. 0.000 2,135.212 ↑ 4.1 191 1

Gather Merge (cost=360,936.29..361,028.23 rows=788 width=197) (actual time=2,122.404..2,135.212 rows=191 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.447 6,344.439 ↑ 6.2 64 3

Sort (cost=359,936.26..359,937.25 rows=394 width=197) (actual time=2,114.801..2,114.813 rows=64 loops=3)

  • Sort Key: deal_row.code
  • Sort Method: quicksort Memory: 34kB
  • Worker 0: Sort Method: quicksort Memory: 33kB
  • Worker 1: Sort Method: quicksort Memory: 34kB
4. 137.520 6,343.992 ↑ 6.2 64 3

Partial HashAggregate (cost=359,909.43..359,919.28 rows=394 width=197) (actual time=2,114.573..2,114.664 rows=64 loops=3)

  • Group Key: deal_row.code
5. 73.166 6,206.472 ↑ 1.3 39,743 3

Nested Loop Left Join (cost=4.82..358,195.22 rows=52,745 width=26) (actual time=0.685..2,068.824 rows=39,743 loops=3)

6. 61.674 5,894.850 ↓ 1.2 39,743 3

Nested Loop Left Join (cost=4.39..313,749.43 rows=32,463 width=26) (actual time=0.674..1,964.950 rows=39,743 loops=3)

7. 21.728 5,475.492 ↓ 1.9 39,743 3

Nested Loop Left Join (cost=3.96..285,581.14 rows=20,574 width=22) (actual time=0.661..1,825.164 rows=39,743 loops=3)

8. 27.313 4,857.624 ↓ 3.0 39,743 3

Nested Loop Left Join (cost=3.53..267,299.26 rows=13,353 width=18) (actual time=0.624..1,619.208 rows=39,743 loops=3)

9. 69.630 3,638.031 ↓ 3.0 39,743 3

Nested Loop (cost=3.09..236,644.21 rows=13,353 width=14) (actual time=0.499..1,212.677 rows=39,743 loops=3)

10. 82.155 2,059.017 ↓ 4.4 62,891 3

Hash Join (cost=2.67..211,309.58 rows=14,457 width=14) (actual time=0.280..686.339 rows=62,891 loops=3)

  • Hash Cond: (deal_row.code = currency.product_article_code)
11. 1,976.565 1,976.565 ↑ 1.2 62,891 3

Parallel Seq Scan on deal_row (cost=0.00..211,102.70 rows=76,971 width=14) (actual time=0.084..658.855 rows=62,891 loops=3)

  • Filter: ((office_id = 8) AND (product_article_type = 'CURRENCY'::text))
  • Rows Removed by Filter: 922585
12. 0.078 0.297 ↑ 1.0 74 3

Hash (cost=1.74..1.74 rows=74 width=4) (actual time=0.099..0.099 rows=74 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
13. 0.219 0.219 ↑ 1.0 74 3

Seq Scan on currency (cost=0.00..1.74 rows=74 width=4) (actual time=0.063..0.073 rows=74 loops=3)

14. 1,509.384 1,509.384 ↑ 1.0 1 188,673

Index Scan using deal_state_pkey on deal_state (cost=0.43..1.75 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=188,673)

  • Index Cond: (deal_id = deal_row.deal_id)
  • Filter: (last_status_state = ANY ('{INVOICED,DRAFT,REVIEW,DONE}'::text[]))
  • Rows Removed by Filter: 0
15. 1,192.280 1,192.280 ↑ 1.0 1 119,228

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_buy_received_table (cost=0.43..2.30 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=119,228)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'BUY_RECEIVED'::text))
16. 596.140 596.140 ↑ 2.0 1 119,228

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_sell_sent_table (cost=0.43..2.31 rows=2 width=8) (actual time=0.005..0.005 rows=1 loops=119,228)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'SELL_SENT'::text))
17. 357.684 357.684 ↑ 2.0 1 119,228

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_paid_table (cost=0.43..2.31 rows=2 width=8) (actual time=0.003..0.003 rows=1 loops=119,228)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'PAID'::text))
18. 238.456 238.456 ↑ 2.0 1 119,228

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_offer_sent_table (cost=0.43..2.31 rows=2 width=8) (actual time=0.002..0.002 rows=1 loops=119,228)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'OFFER_SENT'::text))