explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5Fhw

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.060 4,950.996 ↑ 1.0 100 1

Limit (cost=0.99..21,521.63 rows=100 width=198) (actual time=24.711..4,950.996 rows=100 loops=1)

  • Buffers: shared hit=353145 read=54117 written=16520
2. 0.480 4,950.936 ↑ 67.3 100 1

Nested Loop (cost=0.99..1,448,340.34 rows=6,730 width=198) (actual time=24.709..4,950.936 rows=100 loops=1)

  • Buffers: shared hit=353145 read=54117 written=16520
3. 300.103 4,949.056 ↑ 67.3 100 1

Nested Loop Left Join (cost=0.71..1,446,251.17 rows=6,730 width=183) (actual time=24.690..4,949.056 rows=100 loops=1)

  • Join Filter: (f2.damage_aggregate_id = d0.aggregate_id)
  • Rows Removed by Join Filter: 354103
  • Filter: ((d0.creator_aggregate_id = '32ef45cb-b54a-4d29-bb92-aef88272eb57'::uuid) OR (f2.star_status = 1))
  • Rows Removed by Filter: 354004
  • Buffers: shared hit=352847 read=54115 written=16518
4. 4,648.953 4,648.953 ↑ 1.8 354,104 1

Index Scan Backward using damages_last_changed_at_index on damages d0 (cost=0.42..152,725.12 rows=646,758 width=195) (actual time=0.771..4,648.953 rows=354,104 loops=1)

  • Filter: ((((status)::text <> 'created'::text) OR (damage_identifier IS NOT NULL)) AND (((source)::text = 'dialogue'::text) OR ((source)::text = 'client'::text)))
  • Rows Removed by Filter: 153863
  • Buffers: shared hit=352846 read=54113 written=16518
5. 0.000 0.000 ↑ 100.0 1 354,104

Materialize (cost=0.28..10.29 rows=100 width=20) (actual time=0.000..0.000 rows=1 loops=354,104)

  • Buffers: shared hit=1 read=2
6. 0.001 0.479 ↑ 100.0 1 1

Subquery Scan on f2 (cost=0.28..9.79 rows=100 width=20) (actual time=0.477..0.479 rows=1 loops=1)

  • Buffers: shared hit=1 read=2
7. 0.478 0.478 ↑ 100.0 1 1

Index Scan using users_aggregate_id_index on users s (cost=0.28..8.79 rows=100 width=62) (actual time=0.476..0.478 rows=1 loops=1)

  • Index Cond: (aggregate_id = '32ef45cb-b54a-4d29-bb92-aef88272eb57'::uuid)
  • Buffers: shared hit=1 read=2
8. 1.400 1.400 ↑ 1.0 1 100

Index Scan using users_aggregate_id_index on users u1 (cost=0.28..0.30 rows=1 width=31) (actual time=0.014..0.014 rows=1 loops=100)

  • Index Cond: (aggregate_id = d0.last_changed_by_user_aggregate_id)
  • Buffers: shared hit=298 read=2 written=2
Planning time : 27.748 ms
Execution time : 4,951.226 ms