explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6Fcn

Settings
# exclusive inclusive rows x rows loops node
1. 194.334 8,444.317 ↑ 22,850.2 73 1

Gather (cost=811,468.49..1,254,688.11 rows=1,668,066 width=70) (actual time=8,139.361..8,444.317 rows=73 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 191.994 8,249.983 ↑ 28,959.5 24 3 / 3

Parallel Hash Left Join (cost=810,468.49..1,086,881.51 rows=695,028 width=70) (actual time=8,092.467..8,249.983 rows=24 loops=3)

  • Hash Cond: (deal_row.deal_id = buy_sent.deal_id)
  • Join Filter: (deal_row.quantity > '0'::numeric)
  • Rows Removed by Join Filter: 5
  • Filter: ((sell_sent.id IS NOT NULL) OR (buy_sent.id IS NOT NULL))
  • Rows Removed by Filter: 46
3. 0.083 6,976.834 ↑ 9,789.1 71 3 / 3

Hash Join (cost=556,271.24..809,241.82 rows=695,028 width=78) (actual time=6,719.601..6,976.834 rows=71 loops=3)

  • Hash Cond: (deal.receiver_office_id = receiver_office.id)
4. 0.145 6,976.665 ↑ 4,186.9 166 3 / 3

Hash Join (cost=556,268.82..807,348.46 rows=695,028 width=65) (actual time=6,715.629..6,976.665 rows=166 loops=3)

  • Hash Cond: (deal.sender_office_id = sender_office.id)
5. 315.854 6,976.493 ↑ 3,619.9 192 3 / 3

Parallel Hash Left Join (cost=556,266.40..805,430.98 rows=695,028 width=52) (actual time=6,715.580..6,976.493 rows=192 loops=3)

  • Hash Cond: (deal_row.deal_id = sell_sent.deal_id)
  • Join Filter: (deal_row.quantity < '0'::numeric)
  • Rows Removed by Join Filter: 5
6. 1,248.133 5,487.060 ↑ 1,909.2 192 3 / 3

Parallel Hash Join (cost=296,931.65..533,992.99 rows=366,563 width=40) (actual time=5,205.181..5,487.060 rows=192 loops=3)

  • Hash Cond: (deal_row.deal_id = deal_state.deal_id)
7. 1,388.490 1,388.490 ↑ 1.3 2,729,330 3 / 3

Parallel Seq Scan on deal_row (cost=0.00..181,561.72 rows=3,411,972 width=19) (actual time=0.035..1,388.490 rows=2,729,330 loops=3)

8. 50.040 2,850.437 ↑ 2,294.1 76 3 / 3

Parallel Hash (cost=293,560.28..293,560.28 rows=174,349 width=25) (actual time=2,850.437..2,850.437 rows=76 loops=3)

  • Buckets: 65,536 Batches: 8 Memory Usage: 608kB
9. 611.939 2,800.397 ↑ 2,294.1 76 3 / 3

Parallel Hash Join (cost=152,321.99..293,560.28 rows=174,349 width=25) (actual time=2,625.090..2,800.397 rows=76 loops=3)

  • Hash Cond: (last_status.id = deal_state.last_status_id)
10. 478.459 478.459 ↑ 1.2 1,282,265 3 / 3

Parallel Seq Scan on deal_status last_status (cost=0.00..119,452.12 rows=1,581,791 width=4) (actual time=0.024..478.459 rows=1,282,265 loops=3)

  • Filter: (state = 'REVIEW'::text)
  • Rows Removed by Filter: 1,658,090
11. 150.164 1,709.999 ↑ 1.2 326,800 3 / 3

Parallel Hash (cost=144,488.03..144,488.03 rows=405,117 width=29) (actual time=1,709.998..1,709.999 rows=326,800 loops=3)

  • Buckets: 65,536 Batches: 32 Memory Usage: 2,528kB
12. 818.873 1,559.835 ↑ 1.2 326,800 3 / 3

Parallel Hash Join (cost=74,905.38..144,488.03 rows=405,117 width=29) (actual time=1,205.724..1,559.835 rows=326,800 loops=3)

  • Hash Cond: (deal_state.deal_id = deal.id)
13. 285.690 285.690 ↑ 1.3 1,298,775 3 / 3

Parallel Seq Scan on deal_state (cost=0.00..50,263.97 rows=1,623,497 width=8) (actual time=0.722..285.690 rows=1,298,775 loops=3)

14. 189.674 455.272 ↑ 1.2 326,800 3 / 3

Parallel Hash (cost=67,470.48..67,470.48 rows=404,952 width=21) (actual time=455.272..455.272 rows=326,800 loops=3)

  • Buckets: 65,536 Batches: 16 Memory Usage: 3,968kB
15. 265.598 265.598 ↑ 1.2 326,800 3 / 3

Parallel Seq Scan on deal (cost=0.00..67,470.48 rows=404,952 width=21) (actual time=0.101..265.598 rows=326,800 loops=3)

  • Filter: (agent_id = 1)
  • Rows Removed by Filter: 971,975
16. 371.782 1,173.579 ↑ 1.2 887,454 3 / 3

Parallel Hash (cost=240,065.90..240,065.90 rows=1,108,469 width=16) (actual time=1,173.579..1,173.579 rows=887,454 loops=3)

  • Buckets: 131,072 Batches: 64 Memory Usage: 3,040kB
17. 801.797 801.797 ↑ 1.2 887,454 3 / 3

Parallel Seq Scan on deal_actions sell_sent (cost=0.00..240,065.90 rows=1,108,469 width=16) (actual time=0.021..801.797 rows=887,454 loops=3)

  • Filter: (action = 'SELL_SENT'::text)
  • Rows Removed by Filter: 4,680,610
18. 0.014 0.027 ↑ 1.0 63 3 / 3

Hash (cost=1.63..1.63 rows=63 width=17) (actual time=0.027..0.027 rows=63 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
19. 0.013 0.013 ↑ 1.0 63 3 / 3

Seq Scan on office sender_office (cost=0.00..1.63 rows=63 width=17) (actual time=0.005..0.013 rows=63 loops=3)

20. 0.016 0.086 ↑ 1.0 63 3 / 3

Hash (cost=1.63..1.63 rows=63 width=17) (actual time=0.086..0.086 rows=63 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
21. 0.070 0.070 ↑ 1.0 63 3 / 3

Seq Scan on office receiver_office (cost=0.00..1.63 rows=63 width=17) (actual time=0.060..0.070 rows=63 loops=3)

22. 280.229 1,081.155 ↑ 1.3 649,926 3 / 3

Parallel Hash (cost=240,065.90..240,065.90 rows=812,908 width=16) (actual time=1,081.155..1,081.155 rows=649,926 loops=3)

  • Buckets: 131,072 Batches: 32 Memory Usage: 3,936kB
23. 800.926 800.926 ↑ 1.3 649,926 3 / 3

Parallel Seq Scan on deal_actions buy_sent (cost=0.00..240,065.90 rows=812,908 width=16) (actual time=0.103..800.926 rows=649,926 loops=3)

  • Filter: (action = 'BUY_SENT'::text)
  • Rows Removed by Filter: 4,918,138
Planning time : 3.961 ms
Execution time : 8,445.867 ms