explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PbdT

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

Finalize GroupAggregate (cost=298,484.96..299,614.73 rows=394 width=197) (actual time=2,278.462..2,300.999 rows=65 loops=1)

  • Group Key: deal_row.code
2. 0.000 2,308.743 ↑ 4.2 189 1

Gather Merge (cost=298,484.96..299,579.27 rows=788 width=197) (actual time=2,278.432..2,308.743 rows=189 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 45.432 6,861.612 ↑ 6.3 63 3

Partial GroupAggregate (cost=297,484.94..298,488.30 rows=394 width=197) (actual time=2,267.479..2,287.204 rows=63 loops=3)

  • Group Key: deal_row.code
4. 118.095 6,816.180 ↓ 1.4 39,743 3

Sort (cost=297,484.94..297,555.90 rows=28,386 width=26) (actual time=2,267.228..2,272.060 rows=39,743 loops=3)

  • Sort Key: deal_row.code
  • Sort Method: external merge Disk: 1472kB
  • Worker 0: Sort Method: quicksort Memory: 3963kB
  • Worker 1: Sort Method: quicksort Memory: 4033kB
5. 49.628 6,698.085 ↓ 1.4 39,743 3

Nested Loop Left Join (cost=5.25..295,385.38 rows=28,386 width=26) (actual time=0.748..2,232.695 rows=39,743 loops=3)

6. 74.402 6,410.001 ↓ 2.3 39,743 3

Nested Loop Left Join (cost=4.82..271,466.83 rows=17,470 width=26) (actual time=0.736..2,136.667 rows=39,743 loops=3)

7. 94.186 6,097.143 ↓ 3.6 39,743 3

Nested Loop Left Join (cost=4.39..256,307.92 rows=11,072 width=22) (actual time=0.724..2,032.381 rows=39,743 loops=3)

8. 32.613 5,526.045 ↓ 5.5 39,743 3

Nested Loop Left Join (cost=3.95..246,469.42 rows=7,186 width=18) (actual time=0.699..1,842.015 rows=39,743 loops=3)

9. 17.327 4,420.380 ↓ 5.5 39,743 3

Nested Loop (cost=3.52..229,972.21 rows=7,186 width=14) (actual time=0.580..1,473.460 rows=39,743 loops=3)

10. 188.727 3,082.692 ↓ 8.1 62,874 3

Nested Loop (cost=3.09..223,260.72 rows=7,774 width=18) (actual time=0.411..1,027.564 rows=62,874 loops=3)

11. 84.870 1,950.600 ↓ 4.4 62,891 3

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

  • Hash Cond: (deal_row.code = currency.product_article_code)
12. 1,865.514 1,865.514 ↑ 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.066..621.838 rows=62,891 loops=3)

  • Filter: ((office_id = 8) AND (product_article_type = 'CURRENCY'::text))
  • Rows Removed by Filter: 922585
13. 0.072 0.216 ↑ 1.0 74 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
14. 0.144 0.144 ↑ 1.0 74 3

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

15. 943.365 943.365 ↑ 1.0 1 188,673

Index Scan using deal_pkey on deal (cost=0.43..0.83 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=188,673)

  • Index Cond: (id = deal_row.deal_id)
  • Filter: (agent_id = 1)
  • Rows Removed by Filter: 0
16. 1,320.361 1,320.361 ↑ 1.0 1 188,623

Index Scan using deal_state_pkey on deal_state (cost=0.43..0.86 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=188,623)

  • Index Cond: (deal_id = deal.id)
  • Filter: (last_status_state = ANY ('{INVOICED,DRAFT,REVIEW,DONE}'::text[]))
  • Rows Removed by Filter: 0
17. 1,073.052 1,073.052 ↑ 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.009..0.009 rows=1 loops=119,228)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'BUY_RECEIVED'::text))
18. 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))
19. 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))
20. 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))