explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 39J7

Settings
# exclusive inclusive rows x rows loops node
1. 0.107 258.524 ↑ 1.0 12 1

Limit (cost=20,241.49..20,241.67 rows=12 width=69) (actual time=258.410..258.524 rows=12 loops=1)

2. 0.006 258.417 ↑ 164.7 12 1

Unique (cost=20,241.49..20,271.13 rows=1,976 width=69) (actual time=258.408..258.417 rows=12 loops=1)

3. 0.000 258.411 ↑ 164.7 12 1

Sort (cost=20,241.49..20,246.43 rows=1,976 width=69) (actual time=258.407..258.411 rows=12 loops=1)

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

Gather (cost=1,000.00..20,133.32 rows=1,976 width=69) (actual time=0.953..258.426 rows=41 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
5. 256.899 256.899 ↑ 20.1 41 1

Parallel Seq Scan on social_media_media s0_ (cost=0.00..8,457.98 rows=823 width=49) (actual time=0.145..256.899 rows=41 loops=1)

  • 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: 172306
6.          

SubPlan (forGather)

7. 0.000 0.014 ↑ 1.0 1 41

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

8. 0.014 0.014 ↓ 0.0 0 41

Index Scan using idx_user_object on social_like_like s1_ (cost=0.42..2.64 rows=1 width=37) (actual time=0.014..0.014 rows=0 loops=41)

  • Index Cond: (((user_id)::text = '5cc0d33f-2313-4533-93ba-8aefbe33af03'::text) AND ((object_id)::text = (s0_.id)::text))
9. 0.000 0.010 ↑ 1.0 1 41

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

10. 0.010 0.010 ↓ 0.0 0 41

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

  • Index Cond: (((device_id)::text = '1694b5d7-2dcd-4f00-a3df-c83954e90168'::text) AND ((media_id)::text = (s0_.id)::text))