explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TBUg

Settings
# exclusive inclusive rows x rows loops node
1. 0.154 743.496 ↑ 2.6 56 1

Merge Join (cost=104,501.19..164,974.70 rows=144 width=243) (actual time=127.090..743.496 rows=56 loops=1)

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

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

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

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

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

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

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

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

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

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

7. 0.053 742.449 ↑ 6.9 56 1

Finalize GroupAggregate (cost=104,392.11..164,858.94 rows=389 width=197) (actual time=126.217..742.449 rows=56 loops=1)

  • Group Key: deal_row.code
8. 0.000 742.396 ↑ 5.0 156 1

Gather Merge (cost=104,392.11..164,823.93 rows=778 width=197) (actual time=120.521..742.396 rows=156 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
9. 28.920 1,833.393 ↑ 7.5 52 3

Partial GroupAggregate (cost=103,392.08..163,734.11 rows=389 width=197) (actual time=109.349..611.131 rows=52 loops=3)

  • Group Key: deal_row.code
10. 22.516 1,804.473 ↓ 1.8 8,962 3

Nested Loop Left Join (cost=103,392.08..163,562.66 rows=4,976 width=26) (actual time=98.378..601.491 rows=8,962 loops=3)

11. 7.335 1,728.183 ↓ 2.7 8,962 3

Nested Loop Left Join (cost=103,391.65..144,381.78 rows=3,318 width=26) (actual time=98.364..576.061 rows=8,962 loops=3)

12. 16.951 1,640.187 ↓ 3.9 8,962 3

Nested Loop Left Join (cost=103,391.22..131,062.69 rows=2,304 width=22) (actual time=98.349..546.729 rows=8,962 loops=3)

13. 27.044 1,408.140 ↓ 5.5 8,962 3

Nested Loop Left Join (cost=103,390.78..121,570.53 rows=1,642 width=18) (actual time=98.308..469.380 rows=8,962 loops=3)

14. 15.714 1,112.226 ↓ 5.5 8,962 3

Nested Loop (cost=103,390.35..112,078.36 rows=1,642 width=14) (actual time=98.255..370.742 rows=8,962 loops=3)

15. 21.690 704.904 ↓ 6.1 10,878 3

Nested Loop (cost=103,389.92..110,543.79 rows=1,784 width=18) (actual time=98.165..234.968 rows=10,878 loops=3)

16. 18.366 324.456 ↓ 4.0 13,287 3

Merge Join (cost=103,389.50..103,510.04 rows=3,312 width=14) (actual time=98.062..108.152 rows=13,287 loops=3)

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

Sort (cost=103,385.46..103,428.99 rows=17,411 width=14) (actual time=97.969..101.923 rows=13,287 loops=3)

  • Sort Key: deal_row.code
  • Sort Method: quicksort Memory: 1637kB
  • Worker 0: Sort Method: quicksort Memory: 882kB
  • Worker 1: Sort Method: quicksort Memory: 887kB
18. 260.419 268.269 ↑ 1.3 13,287 3

Parallel Bitmap Heap Scan on deal_row (cost=1,148.75..102,159.05 rows=17,411 width=14) (actual time=3.545..89.423 rows=13,287 loops=3)

  • Recheck Cond: ((office_id = 8) AND (product_article_type = 'CURRENCY'::text))
  • Heap Blocks: exact=6589
19. 7.850 7.850 ↑ 1.0 39,862 1

Bitmap Index Scan on deal_row_office_id_product_article_type_index (cost=0.00..1,138.30 rows=41,787 width=0) (actual time=7.849..7.850 rows=39,862 loops=1)

  • Index Cond: ((office_id = 8) AND (product_article_type = 'CURRENCY'::text))
20. 0.180 0.321 ↑ 1.0 74 3

Sort (cost=4.04..4.22 rows=74 width=4) (actual time=0.084..0.107 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.141 0.141 ↑ 1.0 74 3

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

22. 358.758 358.758 ↑ 1.0 1 39,862

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

  • Index Cond: (id = deal_row.deal_id)
  • Filter: (agent_id = 1)
  • Rows Removed by Filter: 0
23. 391.608 391.608 ↑ 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.012..0.012 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.78 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. 215.096 215.096 ↑ 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.78 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=26,887)

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

Index Scan using deal_actions_deal_id_action_uindex on deal_actions action_paid_table (cost=0.43..5.78 rows=1 width=8) (actual time=0.003..0.003 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.78 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))