explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5OZE

Settings
# exclusive inclusive rows x rows loops node
1. 153.102 272.076 ↑ 11.1 296 1

Nested Loop (cost=767.38..23,994.74 rows=3,284 width=183) (actual time=6.691..272.076 rows=296 loops=1)

  • Join Filter: ((archivable_parent.id = w.id) OR (archivable_parent.id = w.root_workflow_id))
  • Rows Removed by Join Filter: 645132
2. 1.227 1.227 ↑ 1.0 4,361 1

Seq Scan on nflow_workflow w (cost=0.00..327.61 rows=4,361 width=183) (actual time=0.008..1.227 rows=4,361 loops=1)

3. 113.858 117.747 ↑ 2.0 148 4,361

Materialize (cost=767.38..772.63 rows=300 width=4) (actual time=0.001..0.027 rows=148 loops=4,361)

4. 0.054 3.889 ↑ 2.0 148 1

Subquery Scan on archivable_parent (cost=767.38..771.13 rows=300 width=4) (actual time=3.807..3.889 rows=148 loops=1)

5. 0.102 3.835 ↑ 2.0 148 1

Sort (cost=767.38..768.13 rows=300 width=12) (actual time=3.807..3.835 rows=148 loops=1)

  • Sort Key: parent.modified
  • Sort Method: quicksort Memory: 31kB
6. 0.123 3.733 ↑ 2.0 148 1

Hash Anti Join (cost=369.93..755.04 rows=300 width=12) (actual time=2.988..3.733 rows=148 loops=1)

  • Hash Cond: (parent.id = child.root_workflow_id)
7. 0.659 0.659 ↑ 1.4 238 1

Seq Scan on nflow_workflow parent (cost=0.00..360.32 rows=330 width=12) (actual time=0.007..0.659 rows=238 loops=1)

  • Filter: ((next_activation IS NULL) AND (root_workflow_id IS NULL) AND (modified <= (now() - '10 days'::interval)))
  • Rows Removed by Filter: 4123
8. 0.183 2.951 ↑ 1.5 511 1

Hash (cost=360.32..360.32 rows=769 width=4) (actual time=2.951..2.951 rows=511 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
9. 2.768 2.768 ↑ 1.1 674 1

Seq Scan on nflow_workflow child (cost=0.00..360.32 rows=769 width=4) (actual time=0.164..2.768 rows=674 loops=1)

  • Filter: ((modified > (now() - '10 days'::interval)) OR (next_activation IS NOT NULL))
  • Rows Removed by Filter: 3687