explain.depesz.com

PostgreSQL's explain analyze made readable

Result: s48i

Settings
# exclusive inclusive rows x rows loops node
1. 0.051 660.147 ↑ 2.6 56 1

Hash Join (cost=268,253.97..268,543.94 rows=144 width=243) (actual time=655.468..660.147 rows=56 loops=1)

  • Hash Cond: (deal_row.code = currency.product_article_code)
2. 0.000 658.992 ↑ 6.9 56 1

Finalize GroupAggregate (cost=268,146.26..268,429.44 rows=389 width=197) (actual time=654.347..658.992 rows=56 loops=1)

  • Group Key: deal_row.code
3. 0.000 669.560 ↑ 5.0 155 1

Gather Merge (cost=268,146.26..268,394.43 rows=778 width=197) (actual time=654.314..669.560 rows=155 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 9.822 1,764.507 ↑ 7.5 52 3

Partial GroupAggregate (cost=267,146.24..267,304.61 rows=389 width=197) (actual time=584.353..588.169 rows=52 loops=3)

  • Group Key: deal_row.code
5. 24.075 1,754.685 ↓ 2.1 8,962 3

Sort (cost=267,146.24..267,156.85 rows=4,247 width=26) (actual time=584.260..584.895 rows=8,962 loops=3)

  • Sort Key: deal_row.code
  • Sort Method: quicksort Memory: 1052kB
  • Worker 0: Sort Method: quicksort Memory: 1261kB
  • Worker 1: Sort Method: quicksort Memory: 750kB
6. 26.796 1,730.610 ↓ 2.1 8,962 3

Parallel Hash Anti Join (cost=194,941.20..266,890.31 rows=4,247 width=26) (actual time=247.367..576.870 rows=8,962 loops=3)

  • Hash Cond: (deal_row.deal_id = discarded_deal_status.deal_id)
7. 23.703 1,402.767 ↓ 1.6 10,878 3

Nested Loop Left Join (cost=187,657.51..259,543.98 rows=6,653 width=30) (actual time=146.657..467.589 rows=10,878 loops=3)

8. 28.821 1,313.796 ↓ 2.5 10,878 3

Nested Loop Left Join (cost=187,657.08..235,563.97 rows=4,437 width=26) (actual time=146.636..437.932 rows=10,878 loops=3)

9. 8.004 1,219.707 ↓ 3.5 10,878 3

Nested Loop Left Join (cost=187,656.65..218,917.94 rows=3,080 width=22) (actual time=146.609..406.569 rows=10,878 loops=3)

10. 28.644 1,015.899 ↓ 5.0 10,878 3

Nested Loop Left Join (cost=187,656.21..207,049.53 rows=2,196 width=18) (actual time=146.470..338.633 rows=10,878 loops=3)

11. 18.971 758.817 ↓ 5.0 10,878 3

Nested Loop (cost=187,655.78..195,181.13 rows=2,196 width=14) (actual time=145.878..252.939 rows=10,878 loops=3)

12. 14.937 460.812 ↓ 3.3 13,287 3

Merge Join (cost=187,655.35..187,803.68 rows=4,078 width=14) (actual time=145.731..153.604 rows=13,287 loops=3)

  • Merge Cond: (deal_row.code = currency_1.product_article_code)
13. 36.027 445.215 ↑ 1.6 13,287 3

Sort (cost=187,651.32..187,704.90 rows=21,435 width=14) (actual time=145.519..148.405 rows=13,287 loops=3)

  • Sort Key: deal_row.code
  • Sort Method: quicksort Memory: 993kB
  • Worker 0: Sort Method: quicksort Memory: 1147kB
  • Worker 1: Sort Method: quicksort Memory: 881kB
14. 395.852 409.188 ↑ 1.6 13,287 3

Parallel Bitmap Heap Scan on deal_row (cost=1,793.83..186,109.32 rows=21,435 width=14) (actual time=18.416..136.396 rows=13,287 loops=3)

  • Recheck Cond: (office_id = 8)
  • Filter: (product_article_type = 'CURRENCY'::text)
  • Rows Removed by Filter: 16867
  • Heap Blocks: exact=10820
15. 13.336 13.336 ↑ 1.2 90,464 1

Bitmap Index Scan on deal_row_office_id_index (cost=0.00..1,780.96 rows=108,338 width=0) (actual time=13.336..13.336 rows=90,464 loops=1)

  • Index Cond: (office_id = 8)
16. 0.363 0.660 ↑ 1.0 74 3

Sort (cost=4.04..4.22 rows=74 width=4) (actual time=0.202..0.220 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
17. 0.297 0.297 ↑ 1.0 74 3

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

18. 279.034 279.034 ↑ 1.0 1 39,862

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

  • Index Cond: (id = deal_row.deal_id)
  • Filter: (agent_id = 1)
  • Rows Removed by Filter: 0
19. 228.438 228.438 ↓ 0.0 0 32,634

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_buy_received_table (cost=0.43..5.40 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=32,634)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'BUY_RECEIVED'::text))
  • Filter: (created < '2019-01-12 22:00:00+00'::timestamp with time zone)
20. 195.804 195.804 ↑ 1.0 1 32,634

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_sell_sent_table (cost=0.43..5.40 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=32,634)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'SELL_SENT'::text))
  • Filter: (created < '2019-01-12 22:00:00+00'::timestamp with time zone)
21. 65.268 65.268 ↑ 1.0 1 32,634

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_paid_table (cost=0.43..5.40 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=32,634)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'PAID'::text))
  • Filter: (created < '2019-01-12 22:00:00+00'::timestamp with time zone)
22. 65.268 65.268 ↑ 1.0 1 32,634

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_offer_sent_table (cost=0.43..5.40 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=32,634)

  • Index Cond: ((deal_id = deal_row.deal_id) AND (action = 'OFFER_SENT'::text))
  • Filter: (created < '2019-01-12 22:00:00+00'::timestamp with time zone)
23. 28.941 301.047 ↑ 1.2 27,632 3

Parallel Hash (cost=6,860.09..6,860.09 rows=33,888 width=4) (actual time=100.349..100.349 rows=27,632 loops=3)

  • Buckets: 131072 Batches: 1 Memory Usage: 4288kB
24. 272.106 272.106 ↑ 1.2 27,632 3

Parallel Index Only Scan using deal_status_discarder_id_ndx on deal_status discarded_deal_status (cost=0.29..6,860.09 rows=33,888 width=4) (actual time=0.099..90.702 rows=27,632 loops=3)

  • Heap Fetches: 82896
25. 0.025 1.104 ↑ 1.0 74 1

Hash (cost=106.79..106.79 rows=74 width=51) (actual time=1.104..1.104 rows=74 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
26. 0.137 1.079 ↑ 1.0 74 1

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

  • Hash Cond: (product_article_translations.product_article_code = currency.product_article_code)
27. 0.830 0.830 ↑ 1.0 518 1

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

  • Filter: (language = 'et'::bpchar)
  • Rows Removed by Filter: 3862
28. 0.067 0.112 ↑ 1.0 74 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
29. 0.045 0.045 ↑ 1.0 74 1

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