explain.depesz.com

PostgreSQL's explain analyze made readable

Result: icUV

Settings
# exclusive inclusive rows x rows loops node
1. 435.336 745.303 ↑ 6.8 661 1

Nested Loop (cost=758.03..35,016.99 rows=4,487 width=183) (actual time=10.107..745.303 rows=661 loops=1)

  • Join Filter: ((archivable_parent.id = w.id) OR (archivable_parent.id = w.root_workflow_id))
  • Rows Removed by Join Filter: 1679139
  • Buffers: shared hit=846
2. 1.247 1.247 ↑ 1.0 4,540 1

Seq Scan on nflow_workflow w (cost=0.00..327.40 rows=4,540 width=183) (actual time=0.004..1.247 rows=4,540 loops=1)

  • Buffers: shared hit=282
3. 305.293 308.720 ↑ 1.2 370 4,540

Materialize (cost=758.03..765.51 rows=427 width=4) (actual time=0.001..0.068 rows=370 loops=4,540)

  • Buffers: shared hit=564
4. 0.143 3.427 ↑ 1.2 370 1

Subquery Scan on archivable_parent (cost=758.03..763.37 rows=427 width=4) (actual time=3.211..3.427 rows=370 loops=1)

  • Buffers: shared hit=564
5. 0.192 3.284 ↑ 1.2 370 1

Sort (cost=758.03..759.10 rows=427 width=12) (actual time=3.210..3.284 rows=370 loops=1)

  • Sort Key: parent.modified
  • Sort Method: quicksort Memory: 42kB
  • Buffers: shared hit=564
6. 0.204 3.092 ↑ 1.2 370 1

Hash Anti Join (cost=364.60..739.38 rows=427 width=12) (actual time=2.192..3.092 rows=370 loops=1)

  • Hash Cond: (parent.id = child.root_workflow_id)
  • Buffers: shared hit=564
7. 0.723 0.723 ↓ 1.0 473 1

Seq Scan on nflow_workflow parent (cost=0.00..361.45 rows=452 width=12) (actual time=0.007..0.723 rows=473 loops=1)

  • Filter: ((next_activation IS NULL) AND (root_workflow_id IS NULL) AND (modified <= (now() - '1 day'::interval)))
  • Rows Removed by Filter: 4067
  • Buffers: shared hit=282
8. 0.046 2.165 ↑ 1.8 137 1

Hash (cost=361.45..361.45 rows=252 width=4) (actual time=2.165..2.165 rows=137 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
  • Buffers: shared hit=282
9. 2.119 2.119 ↑ 1.8 143 1

Seq Scan on nflow_workflow child (cost=0.00..361.45 rows=252 width=4) (actual time=0.073..2.119 rows=143 loops=1)

  • Filter: ((modified > (now() - '1 day'::interval)) OR (next_activation IS NOT NULL))
  • Rows Removed by Filter: 4397
  • Buffers: shared hit=282