explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xAPH : Optimization for: plan #5O2m

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 2.597 6.930 ↓ 2.0 2 1

Hash Join (cost=1,895.55..2,796.75 rows=1 width=150) (actual time=4.333..6.930 rows=2 loops=1)

  • Hash Cond: (c.channel_id = s.channel_id)
2. 2.847 2.847 ↑ 1.0 33,541 1

Seq Scan on channel c (cost=0.00..775.41 rows=33,541 width=61) (actual time=0.101..2.847 rows=33,541 loops=1)

3. 0.006 1.486 ↓ 2.0 2 1

Hash (cost=1,895.54..1,895.54 rows=1 width=60) (actual time=1.486..1.486 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
4. 0.042 1.480 ↓ 2.0 2 1

Merge Join (cost=1,894.66..1,895.54 rows=1 width=60) (actual time=1.418..1.480 rows=2 loops=1)

  • Merge Cond: (s.channel_id = l.channel_id)
5. 0.009 0.042 ↑ 13.0 3 1

Sort (cost=1,356.19..1,356.29 rows=39 width=40) (actual time=0.041..0.042 rows=3 loops=1)

  • Sort Key: s.channel_id
  • Sort Method: quicksort Memory: 25kB
6. 0.021 0.033 ↑ 13.0 3 1

Bitmap Heap Scan on schedule s (cost=7.07..1,355.16 rows=39 width=40) (actual time=0.022..0.033 rows=3 loops=1)

  • Recheck Cond: (program_id = 1357654)
  • Filter: ((to_timestamp((ends_at)::double precision) >= now()) AND (to_timestamp((starts_at)::double precision) <= (now() + '07:00:00'::interval)))
  • Rows Removed by Filter: 4
  • Heap Blocks: exact=7
7. 0.012 0.012 ↑ 50.0 7 1

Bitmap Index Scan on schedule_new_program_id_idx1 (cost=0.00..7.06 rows=350 width=0) (actual time=0.012..0.012 rows=7 loops=1)

  • Index Cond: (program_id = 1357654)
8. 0.232 1.396 ↓ 4.2 558 1

Sort (cost=538.47..538.81 rows=134 width=20) (actual time=1.358..1.396 rows=558 loops=1)

  • Sort Key: l.channel_id
  • Sort Method: quicksort Memory: 87kB
9. 1.067 1.164 ↓ 6.0 798 1

Bitmap Heap Scan on lineup_channels l (cost=5.48..533.74 rows=134 width=20) (actual time=0.184..1.164 rows=798 loops=1)

  • Recheck Cond: (lineup_id = 53707)
  • Heap Blocks: exact=795
10. 0.097 0.097 ↓ 6.0 798 1

Bitmap Index Scan on lineup_channels_new_lineup_id_idx1 (cost=0.00..5.44 rows=134 width=0) (actual time=0.097..0.097 rows=798 loops=1)

  • Index Cond: (lineup_id = 53707)
Planning time : 0.586 ms
Execution time : 6.989 ms