explain.depesz.com

PostgreSQL's explain analyze made readable

Result: earq

Settings
# exclusive inclusive rows x rows loops node
1. 15.559 185.905 ↑ 20.2 253 1

HashAggregate (cost=576.83..603.10 rows=5,100 width=73) (actual time=184.111..185.905 rows=253 loops=1)

  • Group Key: u.user_id, urt.brand_id, urt.recommended_tags
  • Filter: ((count(ut.tag_id) < 50) AND (sum(CASE WHEN (ut.recommended_ts IS NOT NULL) THEN 1 ELSE 0 END) < 20))
2. 23.008 170.346 ↓ 7.0 1,581 1

Nested Loop Left Join (cost=209.26..572.88 rows=226 width=81) (actual time=1.376..170.346 rows=1,581 loops=1)

3. 63.872 133.058 ↓ 7.3 51 1

Hash Join (cost=208.83..505.40 rows=7 width=69) (actual time=1.304..133.058 rows=51 loops=1)

  • Hash Cond: ((urt.user_id)::text = (u.user_id)::text)
4. 67.940 67.940 ↓ 1.0 10,001 1

Seq Scan on user_recommended_tags urt (cost=0.00..259.00 rows=10,000 width=69) (actual time=0.015..67.940 rows=10,001 loops=1)

  • Filter: ((brand_id)::text = 'AFR'::text)
5. 0.457 1.246 ↑ 1.0 51 1

Hash (cost=208.19..208.19 rows=51 width=12) (actual time=1.240..1.246 rows=51 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
6. 0.789 0.789 ↑ 1.0 51 1

Index Scan using users_pkey on users u (cost=0.29..208.19 rows=51 width=12) (actual time=0.021..0.789 rows=51 loops=1)

  • Index Cond: ((user_id)::text = ANY ('{user_100000,user_100001,user_100002,user_100003,user_100004,user_100005,user_100006,user_100007,user_100008,user_100009,user_100010,user_100011,user_100012,user_100013,user_100014,user_100015,user_100016,user_100017,user_100018,user_100019,user_100020,user_100021,user_100022,user_100023,user_100024,user_100025,user_100026,user_100027,user_100028,user_100029,user_100030,user_100031,user_100032,user_100033,user_100034,user_100035,user_100036,user_100037,user_100038,user_100039,user_100040,user_100041,user_100042,user_100043,user_100044,user_100045,user_100046,user_100047,user_100048,user_100049,user_130049}'::text[]))
  • Filter: (((config -> 'newsfeed'::text) ->> 'mode'::text) = 'automated'::text)
7. 14.280 14.280 ↑ 1.0 31 51

Index Scan using user_tags_user_id_index on user_tags ut (cost=0.43..9.33 rows=31 width=24) (actual time=0.021..0.280 rows=31 loops=51)

  • Index Cond: ((u.user_id)::text = (user_id)::text)
  • Filter: (((brand_id)::text = 'AFR'::text) AND ((tag_followed)::text = 'followed'::text))
  • Rows Removed by Filter: 9
Planning time : 1.227 ms
Execution time : 187.832 ms