explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HqHx

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 1,147.163 ↑ 25,807.3 6 1

Unique (cost=435,266.07..437,201.62 rows=154,844 width=65) (actual time=1,147.157..1,147.163 rows=6 loops=1)

2. 402.726 1,147.158 ↑ 25,807.3 6 1

Sort (cost=435,266.07..435,653.18 rows=154,844 width=65) (actual time=1,147.156..1,147.158 rows=6 loops=1)

  • Sort Key: s0_.likes DESC, s0_.created_at DESC, s0_.id, ((SubPlan 1))
  • Sort Method: external merge Disk: 12720kB
3. 109.824 744.432 ↓ 1.0 158,652 1

Seq Scan on social_media_media s0_ (cost=0.00..421,918.16 rows=154,844 width=65) (actual time=0.184..744.432 rows=158,652 loops=1)

  • Filter: ((processed = 1) AND (status = 0) AND (is_deleted = 0) AND (is_blocked = 0) AND (((likes <= 13) AND (created_at < '2018-12-22 20:55:59'::timestamp without time zone)) OR (likes < 13)))
  • Rows Removed by Filter: 15664
4.          

SubPlan (forSeq Scan)

5. 158.652 634.608 ↑ 1.0 1 158,652

Aggregate (cost=2.64..2.65 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=158,652)

6. 475.956 475.956 ↓ 0.0 0 158,652

Index Scan using idx_device_media on social_media_recolors s1_ (cost=0.42..2.64 rows=1 width=37) (actual time=0.003..0.003 rows=0 loops=158,652)

  • Index Cond: (((device_id)::text = '0a48eaef-fe40-44ca-a7c9-11dd1b0320bf'::text) AND ((media_id)::text = (s0_.id)::text))