explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UTjR

Settings
# exclusive inclusive rows x rows loops node
1. 0.070 730.747 ↑ 2.6 56 1

Merge Join (cost=199,145.83..199,435.68 rows=144 width=243) (actual time=723.932..730.747 rows=56 loops=1)

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

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

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

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

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

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

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

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

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

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

7. 0.000 729.863 ↑ 6.9 56 1

Finalize GroupAggregate (cost=199,036.75..199,319.93 rows=389 width=197) (actual time=723.112..729.863 rows=56 loops=1)

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

Gather Merge (cost=199,036.75..199,284.92 rows=778 width=197) (actual time=723.038..730.737 rows=157 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
9. 15.159 1,985.211 ↑ 7.5 52 3

Partial GroupAggregate (cost=198,036.72..198,195.09 rows=389 width=197) (actual time=655.942..661.737 rows=52 loops=3)

  • Group Key: deal_row.code
10. 32.592 1,970.052 ↓ 2.1 8,962 3

Sort (cost=198,036.72..198,047.34 rows=4,247 width=26) (actual time=655.806..656.684 rows=8,962 loops=3)

  • Sort Key: deal_row.code
  • Sort Method: quicksort Memory: 1221kB
  • Worker 0: Sort Method: quicksort Memory: 821kB
  • Worker 1: Sort Method: quicksort Memory: 828kB
11. 41.451 1,937.460 ↓ 2.1 8,962 3

Parallel Hash Anti Join (cost=125,831.68..197,780.79 rows=4,247 width=26) (actual time=195.201..645.820 rows=8,962 loops=3)

  • Hash Cond: (deal_row.deal_id = discarded_deal_status.deal_id)
12. 26.118 1,567.686 ↓ 1.6 10,878 3

Nested Loop Left Join (cost=118,548.00..190,434.47 rows=6,653 width=30) (actual time=85.047..522.562 rows=10,878 loops=3)

13. 29.619 1,443.666 ↓ 2.5 10,878 3

Nested Loop Left Join (cost=118,547.57..166,454.45 rows=4,437 width=26) (actual time=85.018..481.222 rows=10,878 loops=3)

14. 16.368 1,316.145 ↓ 3.5 10,878 3

Nested Loop Left Join (cost=118,547.13..149,808.42 rows=3,080 width=22) (actual time=84.972..438.715 rows=10,878 loops=3)

15. 17.571 1,038.705 ↓ 5.0 10,878 3

Nested Loop Left Join (cost=118,546.70..137,940.02 rows=2,196 width=18) (actual time=84.863..346.235 rows=10,878 loops=3)

16. 11.081 694.794 ↓ 5.0 10,878 3

Nested Loop (cost=118,546.27..126,071.61 rows=2,196 width=14) (actual time=84.728..231.598 rows=10,878 loops=3)

17. 19.917 285.093 ↓ 3.3 13,287 3

Merge Join (cost=118,545.84..118,694.17 rows=4,078 width=14) (actual time=84.569..95.031 rows=13,287 loops=3)

  • Merge Cond: (deal_row.code = currency_1.product_article_code)
18. 37.368 264.534 ↑ 1.6 13,287 3

Sort (cost=118,541.80..118,595.39 rows=21,435 width=14) (actual time=84.358..88.178 rows=13,287 loops=3)

  • Sort Key: deal_row.code
  • Sort Method: quicksort Memory: 1129kB
  • Worker 0: Sort Method: quicksort Memory: 943kB
  • Worker 1: Sort Method: quicksort Memory: 950kB
19. 219.911 227.166 ↑ 1.6 13,287 3

Parallel Bitmap Heap Scan on deal_row (cost=1,247.72..116,999.80 rows=21,435 width=14) (actual time=10.644..75.722 rows=13,287 loops=3)

  • Recheck Cond: ((office_id = 8) AND (product_article_type = 'CURRENCY'::text))
  • Heap Blocks: exact=5589
20. 7.255 7.255 ↑ 1.3 39,862 1

Bitmap Index Scan on deal_row_office_id_product_article_type_index (cost=0.00..1,234.86 rows=51,443 width=0) (actual time=7.255..7.255 rows=39,862 loops=1)

  • Index Cond: ((office_id = 8) AND (product_article_type = 'CURRENCY'::text))
21. 0.300 0.642 ↑ 1.0 74 3

Sort (cost=4.04..4.22 rows=74 width=4) (actual time=0.192..0.214 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
22. 0.342 0.342 ↑ 1.0 74 3

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

23. 398.620 398.620 ↑ 1.0 1 39,862

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

  • Index Cond: (id = deal_row.deal_id)
  • Filter: (agent_id = 1)
  • Rows Removed by Filter: 0
24. 326.340 326.340 ↓ 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.010..0.010 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)
25. 261.072 261.072 ↑ 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.008..0.008 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)
26. 97.902 97.902 ↑ 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.003..0.003 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)
27. 97.902 97.902 ↑ 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.003..0.003 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)
28. 31.110 328.323 ↑ 1.2 27,632 3

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

  • Buckets: 131072 Batches: 1 Memory Usage: 4320kB
29. 297.213 297.213 ↑ 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.114..99.071 rows=27,632 loops=3)

  • Heap Fetches: 82896