explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZcsR

Settings
# exclusive inclusive rows x rows loops node
1. 0.598 15,600.732 ↓ 1,000.0 1,000 1

Limit (cost=39,416.51..39,416.52 rows=1 width=30) (actual time=15,599.789..15,600.732 rows=1,000 loops=1)

2. 239.893 15,600.134 ↓ 1,000.0 1,000 1

Sort (cost=39,416.51..39,416.52 rows=1 width=30) (actual time=15,599.788..15,600.134 rows=1,000 loops=1)

  • Sort Key: od.order_data_id
  • Sort Method: top-N heapsort Memory: 127kB
3. 2,100.542 15,360.241 ↓ 589,604.0 589,604 1

Nested Loop (cost=5,441.97..39,416.50 rows=1 width=30) (actual time=127.007..15,360.241 rows=589,604 loops=1)

  • Join Filter: ((lbt.lottery_id = ld.lottery_id) AND (((od.order_data_aegis_draw_date + ld.lottery_data_draw_time) + '02:00:00'::interval) < now()))
  • Rows Removed by Join Filter: 2472864
4. 3,095.194 11,728.465 ↓ 765,617.0 765,617 1

Nested Loop (cost=5,441.97..39,415.37 rows=1 width=38) (actual time=73.440..11,728.465 rows=765,617 loops=1)

  • Join Filter: (od.lottery_bet_type_id = lbt.lottery_bet_type_id)
  • Rows Removed by Join Filter: 6890553
5. 5,028.488 5,570.803 ↓ 765,617.0 765,617 1

Gather (cost=5,441.97..39,414.15 rows=1 width=38) (actual time=73.428..5,570.803 rows=765,617 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 314.195 542.315 ↓ 255,206.0 255,206 3

Hash Left Join (cost=4,441.97..38,414.05 rows=1 width=38) (actual time=73.654..542.315 rows=255,206 loops=3)

  • Hash Cond: (od.order_data_wager_number = w.wager_number)
  • Filter: (w.wager_id IS NULL)
  • Rows Removed by Filter: 31908
7. 154.735 154.735 ↑ 1.3 287,112 3

Parallel Seq Scan on orders_data od (cost=0.00..23,154.10 rows=360,410 width=46) (actual time=0.008..154.735 rows=287,112 loops=3)

  • Filter: (order_data_wager IS NOT NULL)
8. 35.154 73.385 ↓ 1.0 96,974 3

Hash (cost=2,756.32..2,756.32 rows=96,932 width=12) (actual time=73.385..73.385 rows=96,974 loops=3)

  • Buckets: 32768 Batches: 8 Memory Usage: 773kB
9. 38.231 38.231 ↓ 1.0 96,974 3

Seq Scan on wagers w (cost=0.00..2,756.32 rows=96,932 width=12) (actual time=0.008..38.231 rows=96,974 loops=3)

10. 3,062.468 3,062.468 ↑ 1.0 10 765,617

Seq Scan on lottery_bet_types lbt (cost=0.00..1.10 rows=10 width=8) (actual time=0.001..0.004 rows=10 loops=765,617)

11. 1,531.234 1,531.234 ↑ 1.0 4 765,617

Seq Scan on lottery_data ld (cost=0.00..1.04 rows=4 width=12) (actual time=0.001..0.002 rows=4 loops=765,617)

Planning time : 0.291 ms
Execution time : 15,601.048 ms