explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bHR

Settings
# exclusive inclusive rows x rows loops node
1. 519.685 14,543.441 ↓ 1.3 458,524 1

Merge Anti Join (cost=8,988,317.33..8,990,426.46 rows=343,381 width=186) (actual time=13,809.760..14,543.441 rows=458,524 loops=1)

  • Merge Cond: (parent.id = child.root_workflow_id)
  • Buffers: shared hit=3810954
2. 1,570.369 13,460.719 ↓ 1.3 469,618 1

Sort (cost=8,955,858.48..8,956,778.27 rows=367,917 width=190) (actual time=13,251.109..13,460.719 rows=469,618 loops=1)

  • Sort Key: parent.id
  • Sort Method: quicksort Memory: 137031kB
  • Buffers: shared hit=3792767
3. 1,931.672 11,890.350 ↓ 1.3 469,618 1

Nested Loop (cost=6.82..8,921,846.36 rows=367,917 width=190) (actual time=0.074..11,890.350 rows=469,618 loops=1)

  • Buffers: shared hit=3792767
4. 426.134 426.134 ↑ 1.0 595,784 1

Seq Scan on nflow_workflow w (cost=0.00..24,192.43 rows=600,543 width=186) (actual time=0.006..426.134 rows=595,784 loops=1)

  • Buffers: shared hit=18187
5. 2,978.920 9,532.544 ↑ 1.0 1 595,784

Bitmap Heap Scan on nflow_workflow parent (cost=6.82..14.81 rows=1 width=4) (actual time=0.015..0.016 rows=1 loops=595,784)

  • Recheck Cond: ((id = w.id) OR (id = w.root_workflow_id))
  • Filter: ((next_activation IS NULL) AND (root_workflow_id IS NULL) AND (modified <= (now() - '1 day'::interval)))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=3774580
6. 1,787.352 6,553.624 ↓ 0.0 0 595,784

BitmapOr (cost=6.82..6.82 rows=2 width=0) (actual time=0.011..0.011 rows=0 loops=595,784)

  • Buffers: shared hit=2837991
7. 2,978.920 2,978.920 ↑ 1.0 1 595,784

Bitmap Index Scan on nflow_workflow_pkey (cost=0.00..3.41 rows=1 width=0) (actual time=0.005..0.005 rows=1 loops=595,784)

  • Index Cond: (id = w.id)
  • Buffers: shared hit=1796753
8. 1,787.352 1,787.352 ↑ 1.0 1 595,784

Bitmap Index Scan on nflow_workflow_pkey (cost=0.00..3.41 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=595,784)

  • Index Cond: (id = w.root_workflow_id)
  • Buffers: shared hit=1041238
9. 37.832 563.037 ↑ 3.6 13,237 1

Sort (cost=32,420.27..32,540.02 rows=47,901 width=4) (actual time=557.623..563.037 rows=13,237 loops=1)

  • Sort Key: child.root_workflow_id
  • Sort Method: quicksort Memory: 3034kB
  • Buffers: shared hit=18187
10. 525.205 525.205 ↑ 1.3 37,058 1

Seq Scan on nflow_workflow child (cost=0.00..28,696.50 rows=47,901 width=4) (actual time=0.026..525.205 rows=37,058 loops=1)

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