explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UvMJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.133 708.459 ↑ 2.6 56 1

Merge Join (cost=169,467.15..229,847.44 rows=144 width=243) (actual time=213.193..708.459 rows=56 loops=1)

  • Merge Cond: (currency.product_article_code = deal_row.code)
2. 0.052 0.837 ↑ 1.0 74 1

Sort (cost=109.08..109.27 rows=74 width=51) (actual time=0.815..0.837 rows=74 loops=1)

  • Sort Key: currency.product_article_code
  • Sort Method: quicksort Memory: 30kB
3. 0.096 0.785 ↑ 1.0 74 1

Hash Right Join (cost=2.67..106.79 rows=74 width=51) (actual time=0.059..0.785 rows=74 loops=1)

  • Hash Cond: (product_article_translations.product_article_code = currency.product_article_code)
4. 0.654 0.654 ↑ 1.0 518 1

Seq Scan on product_article_translations (cost=0.00..102.75 rows=518 width=52) (actual time=0.013..0.654 rows=518 loops=1)

  • Filter: (language = 'et'::bpchar)
  • Rows Removed by Filter: 3862
5. 0.017 0.035 ↑ 1.0 74 1

Hash (cost=1.74..1.74 rows=74 width=8) (actual time=0.035..0.035 rows=74 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
6. 0.018 0.018 ↑ 1.0 74 1

Seq Scan on currency (cost=0.00..1.74 rows=74 width=8) (actual time=0.009..0.018 rows=74 loops=1)

7. 0.000 707.489 ↑ 6.9 56 1

Finalize GroupAggregate (cost=169,358.06..229,731.69 rows=389 width=197) (actual time=212.373..707.489 rows=56 loops=1)

  • Group Key: deal_row.code
8. 0.000 710.166 ↑ 5.0 157 1

Gather Merge (cost=169,358.06..229,696.68 rows=778 width=197) (actual time=205.652..710.166 rows=157 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
9. 23.826 1,951.677 ↑ 7.5 52 3

Partial GroupAggregate (cost=168,358.04..228,606.85 rows=389 width=197) (actual time=190.167..650.559 rows=52 loops=3)

  • Group Key: deal_row.code
10. 16.459 1,927.851 ↓ 1.8 8,962 3

Nested Loop Left Join (cost=168,358.04..228,435.80 rows=4,964 width=26) (actual time=172.929..642.617 rows=8,962 loops=3)

11. 26.713 1,857.618 ↓ 2.7 8,962 3

Nested Loop Left Join (cost=168,357.61..209,285.11 rows=3,310 width=26) (actual time=172.917..619.206 rows=8,962 loops=3)

12. 21.854 1,777.131 ↓ 3.9 8,962 3

Nested Loop Left Join (cost=168,357.18..195,989.56 rows=2,298 width=22) (actual time=172.905..592.377 rows=8,962 loops=3)

13. 11.906 1,567.068 ↓ 5.5 8,962 3

Nested Loop Left Join (cost=168,356.74..186,512.58 rows=1,638 width=18) (actual time=172.879..522.356 rows=8,962 loops=3)

14. 35.994 1,286.292 ↓ 5.5 8,962 3

Nested Loop (cost=168,356.31..177,035.59 rows=1,638 width=14) (actual time=172.814..428.764 rows=8,962 loops=3)

15. 29.581 891.324 ↓ 6.1 10,878 3

Nested Loop (cost=168,355.88..175,505.32 rows=1,779 width=18) (actual time=172.709..297.108 rows=10,878 loops=3)

16. 15.960 542.847 ↓ 4.0 13,287 3

Merge Join (cost=168,355.46..168,475.68 rows=3,303 width=14) (actual time=172.585..180.949 rows=13,287 loops=3)

  • Merge Cond: (deal_row.code = currency_1.product_article_code)
17. 32.847 526.488 ↑ 1.3 13,287 3

Sort (cost=168,351.42..168,394.83 rows=17,364 width=14) (actual time=172.466..175.496 rows=13,287 loops=3)

  • Sort Key: deal_row.code
  • Sort Method: quicksort Memory: 982kB
  • Worker 0: Sort Method: quicksort Memory: 1014kB
  • Worker 1: Sort Method: quicksort Memory: 1026kB
18. 482.056 493.641 ↑ 1.3 13,287 3

Parallel Bitmap Heap Scan on deal_row (cost=1,637.09..167,128.66 rows=17,364 width=14) (actual time=9.722..164.547 rows=13,287 loops=3)

  • Recheck Cond: (office_id = 8)
  • Filter: (product_article_type = 'CURRENCY'::text)
  • Rows Removed by Filter: 16867
  • Heap Blocks: exact=11246
19. 11.585 11.585 ↓ 1.0 90,464 1

Bitmap Index Scan on deal_row_office_id_index (cost=0.00..1,626.67 rows=87,765 width=0) (actual time=11.585..11.585 rows=90,464 loops=1)

  • Index Cond: (office_id = 8)
20. 0.219 0.399 ↑ 1.0 74 3

Sort (cost=4.04..4.22 rows=74 width=4) (actual time=0.113..0.133 rows=74 loops=3)

  • Sort Key: currency_1.product_article_code
  • Sort Method: quicksort Memory: 28kB
  • Worker 0: Sort Method: quicksort Memory: 28kB
  • Worker 1: Sort Method: quicksort Memory: 28kB
21. 0.180 0.180 ↑ 1.0 74 3

Seq Scan on currency currency_1 (cost=0.00..1.74 rows=74 width=4) (actual time=0.043..0.060 rows=74 loops=3)

22. 318.896 318.896 ↑ 1.0 1 39,862

Index Scan using deal_pkey on deal (cost=0.43..2.13 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=39,862)

  • Index Cond: (id = deal_row.deal_id)
  • Filter: (agent_id = 1)
  • Rows Removed by Filter: 0
23. 358.974 358.974 ↑ 1.0 1 32,634

Index Scan using deal_state_pkey on deal_state (cost=0.43..0.86 rows=1 width=4) (actual time=0.011..0.011 rows=1 loops=32,634)

  • Index Cond: (deal_id = deal.id)
  • Filter: (last_status_state = ANY ('{DONE,REVIEW}'::text[]))
  • Rows Removed by Filter: 0
24. 268.870 268.870 ↓ 0.0 0 26,887

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_buy_received_table (cost=0.43..5.79 rows=1 width=8) (actual time=0.010..0.010 rows=0 loops=26,887)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'BUY_RECEIVED'::text))
25. 188.209 188.209 ↑ 1.0 1 26,887

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_sell_sent_table (cost=0.43..5.79 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=26,887)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'SELL_SENT'::text))
26. 53.774 53.774 ↑ 1.0 1 26,887

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_paid_table (cost=0.43..5.79 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=26,887)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'PAID'::text))
27. 53.774 53.774 ↑ 1.0 1 26,887

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_offer_sent_table (cost=0.43..5.79 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=26,887)

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