explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Zi7t

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=0.84..1,187,704.62 rows=10 width=572) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..2,612,949.15 rows=22 width=572) (actual rows= loops=)

  • Join Filter: ((p.user_id = c.user_id) AND ((pt.tag_type_id = 1) OR ((c.creator_type_id = 1000) AND (pt.tag_type_id = 10))))
3. 0.000 0.000 ↓ 0.0

Seq Scan on creators c (cost=0.00..121.52 rows=2,452 width=39) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Materialize (cost=0.84..2,608,965.90 rows=70 width=574) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..2,608,965.55 rows=70 width=574) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..2,599,387.36 rows=1,377 width=572) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Seq Scan on photo_tags pt (cost=0.00..2,569,051.23 rows=3,891 width=39) (actual rows= loops=)

  • Filter: ((NOT is_deleted) AND (name = 'vacation'::text) AND ((tag_type_id = 1) OR (tag_type_id = 10)))
8. 0.000 0.000 ↓ 0.0

Index Scan using photos_pkey on photos p (cost=0.42..7.79 rows=1 width=533) (actual rows= loops=)

  • Index Cond: (id = pt.photo_id)
  • Filter: ((NOT is_deleted) AND (approval_status_id = 1) AND (photo_type_id = 20))
9. 0.000 0.000 ↓ 0.0

Index Scan using one_rating_per_user_for_same_image on image_ratings ir (cost=0.41..6.95 rows=1 width=39) (actual rows= loops=)

  • Index Cond: (photo_id = p.id)
  • Filter: (rated_by <> 'wemark-8ae0027f-cf4c-41e8-a179-f87b81adad1f'::text)