explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pEbG

Settings
# exclusive inclusive rows x rows loops node
1. 16.586 826.909 ↑ 1.2 28,550 1

Sort (cost=190,044.64..190,130.43 rows=34,313 width=20) (actual time=824.703..826.909 rows=28,550 loops=1)

  • Sort Key: ce1.start_time, ce1.last_event_seating_asked_at
  • Sort Method: quicksort Memory: 2999kB
2. 7.602 810.323 ↑ 1.2 28,550 1

Hash Anti Join (cost=3,765.29..187,459.76 rows=34,313 width=20) (actual time=21.830..810.323 rows=28,550 loops=1)

  • Hash Cond: (ce1.id = eslq1.event_id)
3. 17.809 802.665 ↑ 1.2 28,550 1

Hash Join (cost=3,763.14..187,024.41 rows=34,313 width=20) (actual time=21.760..802.665 rows=28,550 loops=1)

  • Hash Cond: (ce1.venue_id = v1.id)
  • Join Filter: (ce1.consecutive_unsuccessful_event_seating_lookup_count < c1.maximum_consecutive_unsuccessful_event_seating_lookup_count)
4. 765.032 765.032 ↑ 4.9 40,107 1

Index Scan using current_event_start_time_idx on current_event ce1 (cost=0.43..181,242.58 rows=195,345 width=28) (actual time=1.917..765.032 rows=40,107 loops=1)

  • Index Cond: (start_time > now())
  • Filter: ((event_seating_updated_at IS NOT NULL) AND (unrecoverable_error IS NULL) AND (CASE WHEN ((last_event_seating_asked_at < (now() - '00:05:00'::interval)) AND (start_time < (now() + '00:15:00'::interval))) THEN 'NEXT_IMMEDIATE'::text WHEN ((last_event_seating_asked_at < (now() - '00:10:00'::interval)) AND (start_time < (now() + '01:00:00'::interval))) THEN 'NEXT_HOUR'::text WHEN ((last_event_seating_asked_at < (now() - '03:00:00'::interval)) AND (start_time < (now() + '1 day'::interval))) THEN 'NEXT_DAY'::text WHEN ((last_event_seating_asked_at < (now() - '06:00:00'::interval)) AND (start_time < (now() + '7 days'::interval))) THEN 'NEXT_WEEK'::text WHEN ((last_event_seating_asked_at < (now() - '06:00:00'::interval)) AND (start_time < (now() + '1 mon'::interval))) THEN 'NEXT_MONTH'::text WHEN (last_event_seating_asked_at < (now() - '12:00:00'::interval)) THEN 'NEXT_FUTURE'::text ELSE NULL::text END IS NOT NULL) AND ((consecutive_unsuccessful_event_seating_lookup_count = 0) OR (last_event_seating_asked_at < (now() - ('00:00:01'::interval * (bound_power((consecutive_unsuccessful_event_seating_lookup_count + 1), 4, 1, 1440))::double precision)))))
  • Rows Removed by Filter: 208917
5. 0.441 19.824 ↑ 1.5 1,954 1

Hash (cost=3,726.84..3,726.84 rows=2,870 width=8) (actual time=19.824..19.824 rows=1,954 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 109kB
6. 0.640 19.383 ↑ 1.5 1,954 1

Hash Join (cost=2,574.01..3,726.84 rows=2,870 width=8) (actual time=5.256..19.383 rows=1,954 loops=1)

  • Hash Cond: (gp1.timezone_id = t1.id)
7. 5.786 18.638 ↑ 1.5 1,954 1

Hash Join (cost=2,563.16..3,708.33 rows=2,870 width=12) (actual time=5.141..18.638 rows=1,954 loops=1)

  • Hash Cond: (gp1.id = v1.google_place_id)
8. 7.732 7.732 ↓ 1.0 26,049 1

Seq Scan on google_place gp1 (cost=0.00..1,022.37 rows=26,037 width=8) (actual time=0.006..7.732 rows=26,049 loops=1)

9. 0.452 5.120 ↑ 1.5 1,954 1

Hash (cost=2,527.29..2,527.29 rows=2,870 width=12) (actual time=5.119..5.120 rows=1,954 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 116kB
10. 0.637 4.668 ↑ 1.3 2,212 1

Nested Loop (cost=0.56..2,527.29 rows=2,870 width=12) (actual time=0.018..4.668 rows=2,212 loops=1)

11. 1.021 1.021 ↑ 1.0 430 1

Index Scan using cinema_pkey on cinema c1 (cost=0.28..567.64 rows=430 width=8) (actual time=0.007..1.021 rows=430 loops=1)

  • Filter: (data_aggregation_disabled_at IS NULL)
  • Rows Removed by Filter: 386
12. 3.010 3.010 ↓ 1.2 5 430

Index Scan using public_venue_cinema_id0_idx on venue v1 (cost=0.28..4.52 rows=4 width=12) (actual time=0.002..0.007 rows=5 loops=430)

  • Index Cond: (cinema_id = c1.id)
13. 0.043 0.105 ↑ 1.0 260 1

Hash (cost=7.60..7.60 rows=260 width=4) (actual time=0.105..0.105 rows=260 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
14. 0.062 0.062 ↑ 1.0 260 1

Seq Scan on timezone t1 (cost=0.00..7.60 rows=260 width=4) (actual time=0.015..0.062 rows=260 loops=1)

15. 0.001 0.056 ↓ 0.0 0 1

Hash (cost=2.14..2.14 rows=1 width=4) (actual time=0.056..0.056 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
16. 0.034 0.055 ↓ 0.0 0 1

Bitmap Heap Scan on event_seating_lookup_queue eslq1 (cost=1.13..2.14 rows=1 width=4) (actual time=0.055..0.055 rows=0 loops=1)

  • Recheck Cond: (attempted_at IS NULL)
  • Heap Blocks: exact=7
17. 0.021 0.021 ↓ 292.0 292 1

Bitmap Index Scan on event_seating_lookup_queue_id_idx (cost=0.00..1.13 rows=1 width=0) (actual time=0.021..0.021 rows=292 loops=1)

Planning time : 1.538 ms
Execution time : 828.719 ms