explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TY4

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 48.616 ↑ 1.0 50 1

Limit (cost=180.91..6,159,061.52 rows=50 width=696) (actual time=13.586..48.616 rows=50 loops=1)

2.          

Initplan (forLimit)

3. 0.028 0.189 ↑ 1.0 30 1

Nested Loop (cost=4.93..179.50 rows=30 width=4) (actual time=0.031..0.189 rows=30 loops=1)

4. 0.025 0.041 ↑ 1.0 30 1

Bitmap Heap Scan on user_groups (cost=4.51..42.00 rows=30 width=4) (actual time=0.021..0.041 rows=30 loops=1)

  • Recheck Cond: (group_id = 967)
  • Heap Blocks: exact=15
5. 0.016 0.016 ↑ 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.016..0.016 rows=30 loops=1)

  • Index Cond: (group_id = 967)
6. 0.120 0.120 ↑ 1.0 1 30

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

  • Index Cond: (id = user_groups.user_id)
  • Heap Fetches: 8
7. 0.076 48.587 ↑ 23.2 50 1

Nested Loop (cost=1.41..143,009,209.09 rows=1,161 width=696) (actual time=13.586..48.587 rows=50 loops=1)

8. 0.063 48.411 ↑ 23.8 50 1

Nested Loop (cost=0.98..142,999,276.08 rows=1,189 width=696) (actual time=13.576..48.411 rows=50 loops=1)

9. 48.248 48.248 ↑ 39.3 50 1

Index Scan Backward using images_date_uploaded_soft_del on images (cost=0.56..142,991,408.28 rows=1,964 width=696) (actual time=13.566..48.248 rows=50 loops=1)

  • Filter: ((status = 2) AND ((creator_type)::text = 'User'::text) AND (creator_id = ANY ($1)))
  • Rows Removed by Filter: 34205
10. 0.100 0.100 ↑ 1.0 1 50

Index Only Scan using users_pkey on users (cost=0.42..4.00 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=50)

  • Index Cond: (id = images.creator_id)
  • Heap Fetches: 0
11. 0.100 0.100 ↑ 1.0 1 50

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

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