explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7K1j

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 45.803 ↑ 1.0 6 1

Limit (cost=28,360.60..28,360.68 rows=6 width=65) (actual time=45.800..45.803 rows=6 loops=1)

2. 0.004 45.802 ↑ 328.8 6 1

Unique (cost=28,360.60..28,385.27 rows=1,973 width=65) (actual time=45.800..45.802 rows=6 loops=1)

3. 0.036 45.798 ↑ 328.8 6 1

Sort (cost=28,360.60..28,365.54 rows=1,973 width=65) (actual time=45.798..45.798 rows=6 loops=1)

  • Sort Key: s0_.likes DESC, s0_.created_at DESC, s0_.id, ((SubPlan 1))
  • Sort Method: quicksort Memory: 30kB
4. 45.598 45.762 ↑ 48.1 41 1

Seq Scan on social_media_media s0_ (cost=0.00..28,252.62 rows=1,973 width=65) (actual time=0.034..45.762 rows=41 loops=1)

  • Filter: ((processed = 1) AND (status = 1) AND (is_deleted = 0) AND (is_blocked = 0) AND (((likes <= 24) AND (created_at < '2018-01-08 06:00:00'::timestamp without time zone)) OR (likes < 24)))
  • Rows Removed by Filter: 171998
5.          

SubPlan (forSeq Scan)

6. 0.000 0.164 ↑ 1.0 1 41

Aggregate (cost=8.44..8.45 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..8.44 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))