explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vjXg

Settings
# exclusive inclusive rows x rows loops node
1. 432.102 746.694 ↑ 6.8 661 1

Nested Loop (cost=758.03..35,016.99 rows=4,487 width=183) (actual time=17.176..746.694 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=852
2. 1.332 1.332 ↑ 1.0 4,540 1

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

  • Buffers: shared hit=282
3. 305.846 313.260 ↑ 1.2 370 4,540

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

  • Buffers: shared hit=570
4. 0.253 7.414 ↑ 1.2 370 1

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

  • Buffers: shared hit=570
5. 0.402 7.161 ↑ 1.2 370 1

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

  • Sort Key: parent.modified
  • Sort Method: quicksort Memory: 42kB
  • Buffers: shared hit=570
6. 0.342 6.759 ↑ 1.2 370 1

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

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

Seq Scan on nflow_workflow parent (cost=0.00..361.45 rows=452 width=12) (actual time=0.011..1.436 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.086 4.981 ↑ 1.8 137 1

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

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

Seq Scan on nflow_workflow child (cost=0.00..361.45 rows=252 width=4) (actual time=0.153..4.895 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