explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B6Ek

Settings
# exclusive inclusive rows x rows loops node
1. 0.214 10.360 ↓ 28.0 56 1

Sort (cost=1,763.97..1,763.98 rows=2 width=1,578) (actual time=10.356..10.360 rows=56 loops=1)

  • Sort Key: (1), livestreamings.start_time
  • Sort Method: quicksort Memory: 137kB
2. 0.065 10.146 ↓ 28.0 56 1

Nested Loop Left Join (cost=65.63..1,763.96 rows=2 width=1,578) (actual time=9.735..10.146 rows=56 loops=1)

  • Join Filter: (livestreamings.id = livestreaming_schedules.livestreaming_id)
  • Rows Removed by Join Filter: 110
3. 0.006 0.729 ↓ 28.0 56 1

Append (cost=65.21..130.45 rows=2 width=1,546) (actual time=0.409..0.729 rows=56 loops=1)

4. 0.126 0.425 ↓ 34.0 34 1

Sort (cost=65.21..65.21 rows=1 width=1,546) (actual time=0.409..0.425 rows=34 loops=1)

  • Sort Key: livestreamings.start_time
  • Sort Method: quicksort Memory: 93kB
5. 0.070 0.299 ↓ 34.0 34 1

Hash Left Join (cost=14.78..65.20 rows=1 width=1,546) (actual time=0.117..0.299 rows=34 loops=1)

  • Hash Cond: (livestreamings.id = premium_contents.premiumable_id)
  • Filter: (premium_contents.id IS NULL)
  • Rows Removed by Filter: 22
6. 0.146 0.146 ↑ 1.6 56 1

Index Scan using index_livestreamings_tv_stream on livestreamings (cost=0.14..50.11 rows=89 width=1,542) (actual time=0.017..0.146 rows=56 loops=1)

7. 0.013 0.083 ↑ 1.1 58 1

Hash (cost=13.88..13.88 rows=61 width=12) (actual time=0.083..0.083 rows=58 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
8. 0.070 0.070 ↑ 1.1 58 1

Seq Scan on premium_contents (cost=0.00..13.88 rows=61 width=12) (actual time=0.008..0.070 rows=58 loops=1)

  • Filter: ((premiumable_type)::text = 'Livestreaming'::text)
  • Rows Removed by Filter: 482
9. 0.067 0.298 ↓ 22.0 22 1

Sort (cost=65.21..65.21 rows=1 width=1,546) (actual time=0.296..0.298 rows=22 loops=1)

  • Sort Key: livestreamings_1.start_time
  • Sort Method: quicksort Memory: 69kB
10. 0.052 0.231 ↓ 22.0 22 1

Hash Join (cost=14.78..65.20 rows=1 width=1,546) (actual time=0.173..0.231 rows=22 loops=1)

  • Hash Cond: (livestreamings_1.id = premium_contents_1.premiumable_id)
11. 0.069 0.069 ↑ 1.6 56 1

Index Scan using index_livestreamings_tv_stream on livestreamings livestreamings_1 (cost=0.14..50.11 rows=89 width=1,542) (actual time=0.012..0.069 rows=56 loops=1)

12. 0.015 0.110 ↑ 1.1 58 1

Hash (cost=13.88..13.88 rows=61 width=4) (actual time=0.110..0.110 rows=58 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
13. 0.095 0.095 ↑ 1.1 58 1

Seq Scan on premium_contents premium_contents_1 (cost=0.00..13.88 rows=61 width=4) (actual time=0.008..0.095 rows=58 loops=1)

  • Filter: ((id IS NOT NULL) AND ((premiumable_type)::text = 'Livestreaming'::text))
  • Rows Removed by Filter: 482
14. 0.036 9.352 ↑ 5.5 2 56

Materialize (cost=0.42..1,633.21 rows=11 width=36) (actual time=0.166..0.167 rows=2 loops=56)

15. 9.316 9.316 ↑ 5.5 2 1

Index Scan using livestreaming_schedule_filter_time on livestreaming_schedules (cost=0.42..1,633.16 rows=11 width=36) (actual time=9.304..9.316 rows=2 loops=1)

  • Index Cond: ((start_time <= '2020-02-03 05:56:54'::timestamp without time zone) AND ('2020-02-03 05:56:54'::timestamp without time zone <= end_time))
Planning time : 3.231 ms
Execution time : 10.616 ms