explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YbT5

Settings
# exclusive inclusive rows x rows loops node
1. 0.049 0.278 ↓ 2.0 2 1

GroupAggregate (cost=12.71..12.73 rows=1 width=532) (actual time=0.247..0.278 rows=2 loops=1)

  • Group Key: ut.user_id
  • Filter: ((count(ut.tag_id) < 50) AND (sum(CASE WHEN (ut.recommended_ts IS NOT NULL) THEN 1 ELSE 0 END) < 20))
2. 0.053 0.229 ↓ 3.0 3 1

Sort (cost=12.71..12.71 rows=1 width=528) (actual time=0.204..0.229 rows=3 loops=1)

  • Sort Key: ut.user_id
  • Sort Method: quicksort Memory: 25kB
3. 0.070 0.176 ↓ 3.0 3 1

Nested Loop Semi Join (cost=0.00..12.70 rows=1 width=528) (actual time=0.045..0.176 rows=3 loops=1)

  • Join Filter: ((ut.user_id)::text = (users.user_id)::text)
  • Rows Removed by Join Filter: 1
4. 0.067 0.067 ↓ 3.0 3 1

Seq Scan on user_tags ut (cost=0.00..1.04 rows=1 width=528) (actual time=0.015..0.067 rows=3 loops=1)

  • Filter: (((brand_id)::text = 'AFR'::text) AND ((tag_followed)::text = 'followed'::text))
5. 0.039 0.039 ↑ 2.0 1 3

Seq Scan on users (cost=0.00..11.62 rows=2 width=516) (actual time=0.009..0.013 rows=1 loops=3)

  • Filter: ((user_id)::text = ANY ('{1,2}'::text[]))
Planning time : 0.167 ms
Execution time : 0.519 ms