explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DSAG

Settings
# exclusive inclusive rows x rows loops node
1. 2.059 7.668 ↓ 0.0 0 1

Nested Loop (cost=869.96..50,148.38 rows=6,273 width=183) (actual time=7.668..7.668 rows=0 loops=1)

  • Join Filter: ((archivable_parent.id = w.id) OR (archivable_parent.id = w.root_workflow_id))
  • Buffers: shared hit=852
2. 1.037 1.037 ↑ 1.4 4,572 1

Seq Scan on nflow_workflow w (cost=0.00..347.32 rows=6,532 width=183) (actual time=0.008..1.037 rows=4,572 loops=1)

  • Buffers: shared hit=282
3. 0.378 4.572 ↓ 0.0 0 4,572

Materialize (cost=869.96..877.45 rows=428 width=4) (actual time=0.001..0.001 rows=0 loops=4,572)

  • Buffers: shared hit=570
4. 0.001 4.194 ↓ 0.0 0 1

Subquery Scan on archivable_parent (cost=869.96..875.31 rows=428 width=4) (actual time=4.194..4.194 rows=0 loops=1)

  • Buffers: shared hit=570
5. 0.024 4.193 ↓ 0.0 0 1

Sort (cost=869.96..871.03 rows=428 width=12) (actual time=4.193..4.193 rows=0 loops=1)

  • Sort Key: parent.modified
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=570
6. 0.050 4.169 ↓ 0.0 0 1

Hash Anti Join (cost=423.66..851.26 rows=428 width=12) (actual time=4.169..4.169 rows=0 loops=1)

  • Hash Cond: (parent.id = child.root_workflow_id)
  • Buffers: shared hit=567
7. 0.667 0.667 ↑ 5.6 82 1

Seq Scan on nflow_workflow parent (cost=0.00..396.31 rows=456 width=12) (actual time=0.008..0.667 rows=82 loops=1)

  • Filter: ((next_activation IS NULL) AND (root_workflow_id IS NULL) AND (modified <= (now() - '30 days'::interval)))
  • Rows Removed by Filter: 4490
  • Buffers: shared hit=282
8. 0.416 3.452 ↑ 2.1 1,058 1

Hash (cost=396.31..396.31 rows=2,188 width=4) (actual time=3.452..3.452 rows=1,058 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 38kB
  • Buffers: shared hit=282
9. 3.036 3.036 ↑ 1.5 1,456 1

Seq Scan on nflow_workflow child (cost=0.00..396.31 rows=2,188 width=4) (actual time=0.026..3.036 rows=1,456 loops=1)

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