explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aCNt

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 180,196.620 ↑ 1.0 11 1

Limit (cost=2,874,192.27..2,874,192.30 rows=11 width=529) (actual time=180,196.613..180,196.620 rows=11 loops=1)

  • Buffers: shared hit=402469 read=389108, temp read=35095 written=35095
2. 17.870 180,196.613 ↑ 39,124.8 11 1

Sort (cost=2,874,192.27..2,875,268.20 rows=430,373 width=529) (actual time=180,196.611..180,196.613 rows=11 loops=1)

  • Sort Key: (max(images.date_uploaded))
  • Sort Method: top-N heapsort Memory: 29kB
  • Buffers: shared hit=402469 read=389108, temp read=35095 written=35095
3. 345.366 180,178.743 ↑ 19.9 21,646 1

GroupAggregate (cost=2,857,064.65..2,864,596.18 rows=430,373 width=529) (actual time=178,132.612..180,178.743 rows=21,646 loops=1)

  • Group Key: locations.id
  • Buffers: shared hit=402469 read=389108, temp read=35095 written=35095
4. 3,598.366 179,833.377 ↓ 1.8 783,203 1

Sort (cost=2,857,064.65..2,858,140.58 rows=430,373 width=529) (actual time=178,132.556..179,833.377 rows=783,203 loops=1)

  • Sort Key: locations.id
  • Sort Method: external sort Disk: 280760kB
  • Buffers: shared hit=402469 read=389108, temp read=35095 written=35095
5. 512.675 176,235.011 ↓ 1.8 783,203 1

Nested Loop (cost=684.09..2,713,818.50 rows=430,373 width=529) (actual time=3.588..176,235.011 rows=783,203 loops=1)

  • Buffers: shared hit=402469 read=389108
6. 50.207 3,693.537 ↑ 1.2 22,461 1

Nested Loop (cost=683.53..245,135.57 rows=26,208 width=525) (actual time=3.576..3,693.537 rows=22,461 loops=1)

  • Buffers: shared hit=80410 read=23851
7. 200.024 202.464 ↑ 1.1 24,062 1

Bitmap Heap Scan on company_projects (cost=683.10..41,728.95 rows=26,797 width=4) (actual time=3.568..202.464 rows=24,062 loops=1)

  • Recheck Cond: (company_id = 1)
  • Filter: owner
  • Heap Blocks: exact=7692
  • Buffers: shared hit=731 read=7057
8. 2.440 2.440 ↑ 1.1 24,062 1

Bitmap Index Scan on index_company_projects_on_company_id_and_owner (cost=0.00..676.40 rows=26,797 width=0) (actual time=2.440..2.440 rows=24,062 loops=1)

  • Index Cond: ((company_id = 1) AND (owner = true))
  • Buffers: shared hit=96
9. 3,440.866 3,440.866 ↑ 1.0 1 24,062

Index Scan using locations_pkey on locations (cost=0.43..7.58 rows=1 width=521) (actual time=0.142..0.143 rows=1 loops=24,062)

  • Index Cond: (id = company_projects.project_id)
  • Filter: active
  • Rows Removed by Filter: 0
  • Buffers: shared hit=79679 read=16794
10. 172,028.799 172,028.799 ↑ 1.1 35 22,461

Index Scan using index_images_on_location_id_and_deleted_at on images (cost=0.56..93.83 rows=37 width=12) (actual time=0.488..7.659 rows=35 loops=22,461)

  • Index Cond: (location_id = locations.id)
  • Buffers: shared hit=322059 read=365257
Planning time : 0.686 ms
Execution time : 180,240.152 ms