explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Bnhh

Settings
# exclusive inclusive rows x rows loops node
1. 0.100 61.233 ↑ 1.0 12 1

Limit (cost=15,000.15..15,000.30 rows=12 width=65) (actual time=61.126..61.233 rows=12 loops=1)

2. 0.003 61.133 ↑ 164.7 12 1

Unique (cost=15,000.15..15,024.85 rows=1,976 width=65) (actual time=61.125..61.133 rows=12 loops=1)

3. 0.000 61.130 ↑ 164.7 12 1

Sort (cost=15,000.15..15,005.09 rows=1,976 width=65) (actual time=61.125..61.130 rows=12 loops=1)

  • Sort Key: s0_.likes DESC, s0_.created_at DESC, s0_.id, ((SubPlan 1))
  • Sort Method: quicksort Memory: 30kB
4. 19.269 61.155 ↑ 48.2 41 1

Gather (cost=1,000.00..14,891.98 rows=1,976 width=65) (actual time=0.368..61.155 rows=41 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 41.878 41.878 ↑ 58.8 14 3

Parallel Seq Scan on social_media_media s0_ (cost=0.00..8,457.98 rows=823 width=49) (actual time=26.661..41.878 rows=14 loops=3)

  • Filter: ((created_at < '2019-01-08 06:00:00'::timestamp without time zone) AND (processed = 1) AND (status = 1) AND (is_deleted = 0) AND (is_blocked = 0))
  • Rows Removed by Filter: 57380
6.          

SubPlan (forGather)

7. 0.001 0.008 ↑ 1.0 1 41

Aggregate (cost=2.64..2.65 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=41)

8. 0.007 0.007 ↓ 0.0 0 41

Index Scan using idx_device_media on social_media_recolors s1_ (cost=0.42..2.64 rows=1 width=37) (actual time=0.007..0.007 rows=0 loops=41)

  • Index Cond: (((device_id)::text = 'b6152328-e0f4-46af-8c35-c2d851acd1ef'::text) AND ((media_id)::text = (s0_.id)::text))