explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 71a5

Settings
# exclusive inclusive rows x rows loops node
1. 0.026 8,030.252 ↑ 1.0 50 1

Limit (cost=6.21..1,429,275.62 rows=50 width=696) (actual time=3,165.968..8,030.252 rows=50 loops=1)

2. 0.118 8,030.226 ↑ 115.0 50 1

Nested Loop (cost=6.21..164,365,988.14 rows=5,750 width=696) (actual time=3,165.967..8,030.226 rows=50 loops=1)

3. 252.789 8,029.858 ↑ 117.8 50 1

Nested Loop (cost=5.78..164,321,896.50 rows=5,892 width=696) (actual time=3,165.945..8,029.858 rows=50 loops=1)

  • Join Filter: (users.id = images.creator_id)
  • Rows Removed by Join Filter: 919738
4. 7,593.109 7,593.109 ↑ 1,590.4 30,660 1

Index Scan Backward using images_date_uploaded_soft_del on images (cost=0.56..142,378,888.43 rows=48,761,822 width=696) (actual time=1,034.879..7,593.109 rows=30,660 loops=1)

  • Filter: ((status = 2) AND ((creator_type)::text = 'User'::text))
  • Rows Removed by Filter: 3595
5. 182.652 183.960 ↑ 1.0 30 30,660

Materialize (cost=5.21..188.24 rows=30 width=8) (actual time=0.000..0.006 rows=30 loops=30,660)

6. 0.032 1.308 ↑ 1.0 30 1

Nested Loop (cost=5.21..188.09 rows=30 width=8) (actual time=0.994..1.308 rows=30 loops=1)

7. 0.474 0.474 ↑ 1.0 1 1

Index Only Scan using groups_pkey on groups (cost=0.28..8.29 rows=1 width=4) (actual time=0.474..0.474 rows=1 loops=1)

  • Index Cond: (id = 967)
  • Heap Fetches: 1
8. 0.067 0.802 ↑ 1.0 30 1

Nested Loop (cost=4.93..179.50 rows=30 width=12) (actual time=0.511..0.802 rows=30 loops=1)

9. 0.058 0.525 ↑ 1.0 30 1

Bitmap Heap Scan on user_groups (cost=4.51..42.00 rows=30 width=8) (actual time=0.478..0.525 rows=30 loops=1)

  • Recheck Cond: (group_id = 967)
  • Heap Blocks: exact=15
10. 0.467 0.467 ↑ 1.0 30 1

Bitmap Index Scan on index_user_groups_on_group_id_and_user_id (cost=0.00..4.51 rows=30 width=0) (actual time=0.467..0.467 rows=30 loops=1)

  • Index Cond: (group_id = 967)
11. 0.210 0.210 ↑ 1.0 1 30

Index Only Scan using users_pkey on users (cost=0.42..4.57 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=30)

  • Index Cond: (id = user_groups.user_id)
  • Heap Fetches: 8
12. 0.250 0.250 ↑ 1.0 1 50

Index Scan using locations_pkey on locations (cost=0.43..7.47 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=50)

  • Index Cond: (id = images.location_id)
  • Filter: active