explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OTYD

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 645.603 ↓ 0.0 0 1

Limit (cost=830.85..17,615.55 rows=100 width=20) (actual time=645.603..645.603 rows=0 loops=1)

2. 0.000 645.601 ↓ 0.0 0 1

Nested Loop Anti Join (cost=830.85..130,912.34 rows=775 width=20) (actual time=645.601..645.601 rows=0 loops=1)

3. 0.219 645.601 ↓ 0.0 0 1

Nested Loop (cost=830.57..130,676.77 rows=776 width=20) (actual time=645.601..645.601 rows=0 loops=1)

4. 81.398 636.400 ↓ 1.7 1,497 1

Nested Loop (cost=830.14..128,994.21 rows=864 width=20) (actual time=11.454..636.400 rows=1,497 loops=1)

  • Join Filter: (c1.id = eslarv1.cinema_id)
  • Rows Removed by Join Filter: 779866
5. 0.783 504.104 ↑ 2.4 1,497 1

Nested Loop (cost=0.98..117,597.36 rows=3,524 width=28) (actual time=7.636..504.104 rows=1,497 loops=1)

  • Join Filter: (ce1.consecutive_unsuccessful_event_seating_lookup_count < c1.maximum_consecutive_unsuccessful_event_seating_lookup_count)
6. 3.962 492.527 ↑ 3.7 5,397 1

Nested Loop (cost=0.71..108,967.33 rows=20,062 width=28) (actual time=0.713..492.527 rows=5,397 loops=1)

7. 477.771 477.771 ↑ 3.7 5,397 1

Index Scan using current_event_start_time_idx on current_event ce1 (cost=0.43..95,610.26 rows=20,062 width=28) (actual time=0.695..477.771 rows=5,397 loops=1)

  • Index Cond: (start_time > now())
  • Filter: ((event_seating_updated_at IS NULL) AND (unrecoverable_error IS NULL) AND (last_event_seating_asked_at < (now() - '00:10:00'::interval)))
  • Rows Removed by Filter: 244322
8. 10.794 10.794 ↑ 1.0 1 5,397

Index Scan using venue_pkey on venue v1 (cost=0.28..0.67 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=5,397)

  • Index Cond: (id = ce1.venue_id)
9. 10.794 10.794 ↓ 0.0 0 5,397

Index Scan using cinema_pkey on cinema c1 (cost=0.28..0.42 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=5,397)

  • Index Cond: (id = v1.cinema_id)
  • Filter: (data_aggregation_disabled_at IS NULL)
  • Rows Removed by Filter: 1
10. 46.758 50.898 ↓ 2.6 522 1,497

Materialize (cost=829.16..837.23 rows=200 width=4) (actual time=0.003..0.034 rows=522 loops=1,497)

11. 0.115 4.140 ↓ 4.1 816 1

Subquery Scan on eslarv1 (cost=829.16..836.23 rows=200 width=4) (actual time=3.770..4.140 rows=816 loops=1)

12. 0.193 4.025 ↓ 4.1 816 1

Unique (cost=829.16..834.23 rows=200 width=12) (actual time=3.768..4.025 rows=816 loops=1)

13. 0.277 3.832 ↑ 1.2 820 1

Sort (cost=829.16..831.70 rows=1,015 width=12) (actual time=3.767..3.832 rows=820 loops=1)

  • Sort Key: "*SELECT* 1".cinema_id, ((0)::bigint) DESC
  • Sort Method: quicksort Memory: 63kB
14. 0.405 3.555 ↑ 1.2 821 1

HashAggregate (cost=758.17..768.32 rows=1,015 width=12) (actual time=3.386..3.555 rows=821 loops=1)

  • Group Key: "*SELECT* 1".cinema_id, ((0)::bigint)
15. 0.090 3.150 ↑ 1.2 821 1

Append (cost=0.28..753.10 rows=1,015 width=12) (actual time=0.008..3.150 rows=821 loops=1)

16. 0.134 0.443 ↑ 1.0 816 1

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

17. 0.309 0.309 ↑ 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.006..0.309 rows=816 loops=1)

  • Heap Fetches: 66
18. 0.053 2.617 ↑ 39.8 5 1

HashAggregate (cost=657.33..659.32 rows=199 width=12) (actual time=2.615..2.617 rows=5 loops=1)

  • Group Key: e1_1.cinema_id
19. 0.003 2.564 ↑ 1.2 168 1

Nested Loop (cost=0.85..656.33 rows=199 width=4) (actual time=0.040..2.564 rows=168 loops=1)

20. 1.553 1.553 ↑ 1.2 168 1

Index Scan using event_seating_lookup_ended_at_idx on event_seating_lookup esl1 (cost=0.42..170.28 rows=199 width=4) (actual time=0.026..1.553 rows=168 loops=1)

  • Index Cond: (ended_at IS NULL)
21. 1.008 1.008 ↑ 1.0 1 168

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

  • Index Cond: (id = esl1.event_id)
22. 8.982 8.982 ↓ 0.0 0 1,497

Index Scan using event_pkey on event e1 (cost=0.43..1.95 rows=1 width=4) (actual time=0.006..0.006 rows=0 loops=1,497)

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

Index Only Scan using event_seating_lookup_queue_event_id_idx on event_seating_lookup_queue eslq1 (cost=0.27..0.30 rows=1 width=4) (never executed)

  • Index Cond: (event_id = ce1.id)
  • Heap Fetches: 0
Planning time : 2.296 ms
Execution time : 645.784 ms