explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BFyd

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.428 ↑ 1.0 12 1

Limit (cost=6,317.03..6,317.18 rows=12 width=65) (actual time=0.423..0.428 rows=12 loops=1)

2. 0.005 0.426 ↑ 164.6 12 1

Unique (cost=6,317.03..6,341.72 rows=1,975 width=65) (actual time=0.421..0.426 rows=12 loops=1)

3. 0.051 0.421 ↑ 164.6 12 1

Sort (cost=6,317.03..6,321.97 rows=1,975 width=65) (actual time=0.421..0.421 rows=12 loops=1)

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

Index Scan using idx_media_availability on social_media_media s0_ (cost=0.42..6,208.92 rows=1,975 width=65) (actual time=0.151..0.370 rows=41 loops=1)

  • Index Cond: ((processed = 1) AND (status = 1) AND (is_blocked = 0) AND (is_deleted = 0))
  • Filter: (created_at < '2019-01-09 09:30:00'::timestamp without time zone)
5.          

SubPlan (forIndex Scan)

6. 0.000 0.164 ↑ 1.0 1 41

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

7. 0.164 0.164 ↓ 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.004..0.004 rows=0 loops=41)

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