explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hE6Z

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 5,497.147 ↓ 0.0 0 1

Sort (cost=36,571.35..36,577.90 rows=2,617 width=20) (actual time=5,497.147..5,497.147 rows=0 loops=1)

  • Sort Key: ce1.start_time, ce1.last_event_seating_asked_at
  • Sort Method: quicksort Memory: 25kB
2. 0.000 5,497.138 ↓ 0.0 0 1

Hash Anti Join (cost=1,166.03..36,422.79 rows=2,617 width=20) (actual time=5,497.138..5,497.138 rows=0 loops=1)

  • Hash Cond: (ce1.id = eslq1.event_id)
3. 24.570 5,497.138 ↓ 0.0 0 1

Nested Loop (cost=1,163.87..36,387.60 rows=2,617 width=20) (actual time=5,497.138..5,497.138 rows=0 loops=1)

4. 12.635 5,358.380 ↓ 9.8 28,547 1

Nested Loop (cost=1,163.44..33,362.97 rows=2,913 width=20) (actual time=13.832..5,358.380 rows=28,547 loops=1)

  • Join Filter: (ce1.consecutive_unsuccessful_event_seating_lookup_count < c1.maximum_consecutive_unsuccessful_event_seating_lookup_count)
5. 3.302 38.681 ↓ 8.4 1,954 1

Hash Join (cost=1,163.02..1,733.10 rows=234 width=8) (actual time=4.888..38.681 rows=1,954 loops=1)

  • Hash Cond: (gp1.timezone_id = t1.id)
6. 5.200 35.216 ↓ 8.4 1,954 1

Nested Loop (cost=1,152.17..1,721.63 rows=234 width=12) (actual time=4.711..35.216 rows=1,954 loops=1)

7. 1.118 18.956 ↓ 9.5 2,212 1

Nested Loop (cost=1,151.88..1,614.34 rows=234 width=12) (actual time=4.699..18.956 rows=2,212 loops=1)

8. 0.817 9.668 ↓ 12.3 430 1

Nested Loop (cost=1,151.60..1,454.84 rows=35 width=12) (actual time=4.684..9.668 rows=430 loops=1)

9. 0.580 5.587 ↓ 4.1 816 1

Unique (cost=1,151.32..1,156.84 rows=200 width=12) (actual time=4.663..5.587 rows=816 loops=1)

10. 0.663 5.007 ↑ 1.3 824 1

Sort (cost=1,151.32..1,154.08 rows=1,103 width=12) (actual time=4.661..5.007 rows=824 loops=1)

  • Sort Key: "*SELECT* 1".cinema_id, ((0)::bigint) DESC
  • Sort Method: quicksort Memory: 63kB
11. 0.701 4.344 ↑ 1.3 824 1

HashAggregate (cost=1,073.52..1,084.55 rows=1,103 width=12) (actual time=4.017..4.344 rows=824 loops=1)

  • Group Key: "*SELECT* 1".cinema_id, ((0)::bigint)
12. 0.110 3.643 ↑ 1.3 824 1

Append (cost=0.28..1,068.01 rows=1,103 width=12) (actual time=0.013..3.643 rows=824 loops=1)

13. 0.176 0.624 ↑ 1.0 816 1

Subquery Scan on *SELECT* 1 (cost=0.28..86.72 rows=816 width=12) (actual time=0.013..0.624 rows=816 loops=1)

14. 0.448 0.448 ↑ 1.0 816 1

Index Only Scan using cinema_pkey on cinema c1_1 (cost=0.28..76.52 rows=816 width=8) (actual time=0.010..0.448 rows=816 loops=1)

  • Heap Fetches: 66
15. 0.028 2.909 ↑ 35.9 8 1

HashAggregate (cost=970.04..972.91 rows=287 width=12) (actual time=2.903..2.909 rows=8 loops=1)

  • Group Key: e1_1.cinema_id
16. 0.021 2.881 ↑ 10.2 28 1

Nested Loop (cost=0.85..968.60 rows=287 width=4) (actual time=0.057..2.881 rows=28 loops=1)

17. 2.552 2.552 ↑ 10.2 28 1

Index Scan using event_seating_lookup_ended_at_idx on event_seating_lookup esl1 (cost=0.42..268.17 rows=287 width=4) (actual time=0.039..2.552 rows=28 loops=1)

  • Index Cond: (ended_at IS NULL)
18. 0.308 0.308 ↑ 1.0 1 28

Index Scan using event_pkey on event e1_1 (cost=0.43..2.44 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=28)

  • Index Cond: (id = esl1.event_id)
19. 3.264 3.264 ↑ 1.0 1 816

Index Scan using cinema_pkey on cinema c1 (cost=0.28..1.47 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=816)

  • Index Cond: (id = "*SELECT* 1".cinema_id)
  • Filter: ((data_aggregation_disabled_at IS NULL) AND (((0)::bigint) < maximum_event_seating_lookup_concurrency))
  • Rows Removed by Filter: 0
20. 8.170 8.170 ↓ 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.004..0.019 rows=5 loops=430)

  • Index Cond: (cinema_id = c1.id)
21. 11.060 11.060 ↑ 1.0 1 2,212

Index Scan using google_place_pkey on google_place gp1 (cost=0.29..0.46 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=2,212)

  • Index Cond: (id = v1.google_place_id)
22. 0.058 0.163 ↑ 1.0 260 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
23. 0.105 0.105 ↑ 1.0 260 1

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

24. 5,307.064 5,307.064 ↑ 7.4 15 1,954

Index Scan using current_event_venue_id_idx on current_event ce1 (cost=0.42..133.78 rows=111 width=28) (actual time=1.315..2.716 rows=15 loops=1,954)

  • Index Cond: (venue_id = v1.id)
  • Filter: ((event_seating_updated_at IS NOT NULL) AND (unrecoverable_error IS NULL) AND (start_time > now()) 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: 245
25. 114.188 114.188 ↓ 0.0 0 28,547

Index Scan using event_pkey on event e1 (cost=0.43..1.04 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=28,547)

  • Index Cond: (id = ce1.id)
  • Filter: ((unlisted_at IS NULL) AND (auditorium_id IS NOT NULL))
  • Rows Removed by Filter: 1
26. 0.000 0.000 ↓ 0.0 0

Hash (cost=2.14..2.14 rows=1 width=4) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on event_seating_lookup_queue eslq1 (cost=1.13..2.14 rows=1 width=4) (never executed)

  • Recheck Cond: (attempted_at IS NULL)
28. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on event_seating_lookup_queue_id_idx (cost=0.00..1.13 rows=1 width=0) (never executed)

Planning time : 7.751 ms
Execution time : 5,497.493 ms