explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uQo

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 1,168.159 ↑ 1.0 6 1

Limit (cost=440,151.22..440,151.30 rows=6 width=65) (actual time=1,168.147..1,168.159 rows=6 loops=1)

2. 0.007 1,168.151 ↑ 26,100.8 6 1

Unique (cost=440,151.22..442,108.78 rows=156,605 width=65) (actual time=1,168.145..1,168.151 rows=6 loops=1)

3. 468.373 1,168.144 ↑ 26,100.8 6 1

Sort (cost=440,151.22..440,542.73 rows=156,605 width=65) (actual time=1,168.144..1,168.144 rows=6 loops=1)

  • Sort Key: s0_.likes DESC, s0_.created_at DESC, s0_.id, ((SubPlan 1))
  • Sort Method: external merge Disk: 12720kB
4. 223.728 699.771 ↓ 1.0 158,681 1

Seq Scan on social_media_media s0_ (cost=0.00..426,638.74 rows=156,605 width=65) (actual time=0.044..699.771 rows=158,681 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: 15666
5.          

SubPlan (forSeq Scan)

6. 0.000 476.043 ↑ 1.0 1 158,681

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

7. 476.043 476.043 ↓ 0.0 0 158,681

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,681)

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