Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Limit (cost=1192377.73..1192377.85 rows=12 width=90) (actual time=4783.578..4783.596 rows=12 loops=1)
- -> Unique (cost=1192377.73..1192395.89 rows=1816 width=90) (actual time=4783.577..4783.586 rows=12 loops=1)
- -> Sort (cost=1192377.73..1192382.27 rows=1816 width=90) (actual time=4783.576..4783.578 rows=12 loops=1)
- Sort Key: (sum(COALESCE(((channels.metrics ->> 'viewers'::text))::integer, 0))) DESC, segments.game_id, (count(broadcasts.id))
- Sort Method: quicksort Memory: 411kB
- -> GroupAggregate (cost=1191506.47..1192279.42 rows=1816 width=90) (actual time=4731.425..4780.437 rows=2239 loops=1)
- Group Key: segments.game_id
- -> Sort (cost=1191506.47..1191614.30 rows=43131 width=114) (actual time=4731.404..4752.587 rows=46780 loops=1)
- Sort Key: segments.game_id
- Sort Method: external merge Disk: 6472kB
- -> Nested Loop (cost=1.00..1185529.65 rows=43131 width=114) (actual time=214.650..4593.009 rows=46780 loops=1)
- -> Nested Loop (cost=0.43..949955.16 rows=7445 width=77) (actual time=214.606..4040.531 rows=38423 loops=1)
- -> Seq Scan on broadcasts (cost=0.00..903461.73 rows=7887 width=53) (actual time=214.565..3769.027 rows=38489 loops=1)
- Filter: ((deleted_at IS NULL) AND (ends_at IS NULL) AND (channel_id IS NOT NULL) AND (type = 'system_recorded'::broadcast_type) AND (starts_at <= now()) AND (starts_at >= (now() - '10 days'::interval)))
- Rows Removed by Filter: 17444690
- -> Index Scan using channels_id_key on channels (cost=0.43..5.89 rows=1 width=77) (actual time=0.005..0.005 rows=1 loops=38489)
- Index Cond: (id = (broadcasts.channel_id)::uuid)
- Filter: ((deleted_at IS NULL) AND (metrics IS NOT NULL))
- Rows Removed by Filter: 0
- -> Index Scan using segments_broadcast_idx on segments (cost=0.57..31.58 rows=6 width=74) (actual time=0.012..0.013 rows=1 loops=38423)
- Index Cond: (broadcast_id = (broadcasts.id)::text)
- Filter: ((game_id IS NOT NULL) AND (deleted_at IS NULL) AND (segment_type = 'game_played'::segment_type))
- Rows Removed by Filter: 1
- Planning time: 1.111 ms
- Execution time: 4785.401 ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement