explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zVqs

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

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

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

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

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.261 5,387.475 ↑ 6.2 64 3

Sort (cost=359,936.26..359,937.25 rows=394 width=197) (actual time=1,795.819..1,795.825 rows=64 loops=3)

  • Sort Key: deal_row.code
  • Sort Method: quicksort Memory: 33kB
  • Worker 0: Sort Method: quicksort Memory: 34kB
  • Worker 1: Sort Method: quicksort Memory: 33kB
4. 115.017 5,387.214 ↑ 6.2 64 3

Partial HashAggregate (cost=359,909.43..359,919.28 rows=394 width=197) (actual time=1,795.681..1,795.738 rows=64 loops=3)

  • Group Key: deal_row.code
5. 43.727 5,272.197 ↑ 1.3 39,743 3

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

6. 74.345 4,990.014 ↓ 1.2 39,743 3

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

7. 81.310 4,677.213 ↓ 1.9 39,743 3

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

8. 97.955 4,118.991 ↓ 3.0 39,743 3

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

9. 128.205 3,067.212 ↓ 3.0 39,743 3

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

10. 74.442 1,806.969 ↓ 4.4 62,891 3

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

  • Hash Cond: (deal_row.code = currency.product_article_code)
11. 1,732.293 1,732.293 ↑ 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.058..577.431 rows=62,891 loops=3)

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

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

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

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

14. 1,132.038 1,132.038 ↑ 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.006..0.006 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. 953.824 953.824 ↑ 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.008..0.008 rows=1 loops=119,228)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'BUY_RECEIVED'::text))
16. 476.912 476.912 ↑ 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.004..0.004 rows=1 loops=119,228)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'SELL_SENT'::text))
17. 238.456 238.456 ↑ 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.002..0.002 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))