explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Tk6F : Optimization for: Optimization for: Optimization for: Optimization for: plan #5Fhw; plan #fT3t; plan #vEwG; plan #4UsR

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.012 408.576 ↑ 1.0 31 1

Limit (cost=0.99..6,672.18 rows=31 width=198) (actual time=10.230..408.576 rows=31 loops=1)

  • Buffers: shared hit=171690 read=13946
2. 0.121 408.564 ↑ 217.1 31 1

Nested Loop (cost=0.99..1,448,295.71 rows=6,730 width=198) (actual time=10.229..408.564 rows=31 loops=1)

  • Buffers: shared hit=171690 read=13946
3. 95.398 406.645 ↑ 217.1 31 1

Nested Loop Left Join (cost=0.71..1,446,206.54 rows=6,730 width=183) (actual time=10.215..406.645 rows=31 loops=1)

  • Join Filter: (f2.damage_aggregate_id = d0.aggregate_id)
  • Rows Removed by Join Filter: 154279
  • Filter: ((d0.creator_aggregate_id = '32ef45cb-b54a-4d29-bb92-aef88272eb57'::uuid) OR (f2.star_status = 1))
  • Rows Removed by Filter: 154249
  • Buffers: shared hit=171599 read=13944
4. 311.247 311.247 ↑ 4.2 154,280 1

Index Scan using test_3 on damages d0 (cost=0.42..152,724.49 rows=646,736 width=195) (actual time=0.966..311.247 rows=154,280 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: 52682
  • Buffers: shared hit=171596 read=13944
5. 0.000 0.000 ↑ 100.0 1 154,280

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

  • Buffers: shared hit=3
6. 0.002 0.023 ↑ 100.0 1 1

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

  • Buffers: shared hit=3
7. 0.021 0.021 ↑ 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.020..0.021 rows=1 loops=1)

  • Index Cond: (aggregate_id = '32ef45cb-b54a-4d29-bb92-aef88272eb57'::uuid)
  • Buffers: shared hit=3
8. 1.798 1.798 ↑ 1.0 1 31

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

  • Index Cond: (aggregate_id = d0.last_changed_by_user_aggregate_id)
  • Buffers: shared hit=91 read=2
Planning time : 3.345 ms
Execution time : 408.665 ms