explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FJ0C

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 1.4 458,706 1

Merge Anti Join (cost=8,771,898.09..8,773,935.37 rows=336,398 width=186) (actual rows=458,706 loops=1)

  • Merge Cond: (parent.id = child.root_workflow_id)
  • Buffers: shared hit=3792438
2. 0.000 0.000 ↓ 1.3 468,762 1

Sort (cost=8,740,284.04..8,741,186.68 rows=361,055 width=190) (actual rows=468,762 loops=1)

  • Sort Key: parent.id
  • Sort Method: quicksort Memory: 136803kB
  • Buffers: shared hit=3774251
3. 0.000 0.000 ↓ 1.3 468,762 1

Nested Loop (cost=6.82..8,706,955.31 rows=361,055 width=190) (actual rows=468,762 loops=1)

  • Buffers: shared hit=3774251
4. 0.000 0.000 ↓ 1.0 592,380 1

Seq Scan on nflow_workflow w (cost=0.00..24,047.44 rows=586,044 width=186) (actual rows=592,380 loops=1)

  • Buffers: shared hit=18187
5. 0.000 0.000 ↑ 1.0 1 592,380

Bitmap Heap Scan on nflow_workflow parent (cost=6.82..14.81 rows=1 width=4) (actual rows=1 loops=592,380)

  • 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=3756064
6. 0.000 0.000 ↓ 0.0 0 592,380

BitmapOr (cost=6.82..6.82 rows=2 width=0) (actual rows=0 loops=592,380)

  • Buffers: shared hit=2824754
7. 0.000 0.000 ↑ 1.0 1 592,380

Bitmap Index Scan on nflow_workflow_pkey (cost=0.00..3.41 rows=1 width=0) (actual rows=1 loops=592,380)

  • Index Cond: (id = w.id)
  • Buffers: shared hit=1786338
8. 0.000 0.000 ↑ 1.0 1 592,380

Bitmap Index Scan on nflow_workflow_pkey (cost=0.00..3.41 rows=1 width=0) (actual rows=1 loops=592,380)

  • Index Cond: (id = w.root_workflow_id)
  • Buffers: shared hit=1038416
9. 0.000 0.000 ↑ 3.6 11,278 1

Sort (cost=31,580.45..31,682.84 rows=40,957 width=4) (actual rows=11,278 loops=1)

  • Sort Key: child.root_workflow_id
  • Sort Method: quicksort Memory: 2869kB
  • Buffers: shared hit=18187
10. 0.000 0.000 ↑ 1.2 32,828 1

Seq Scan on nflow_workflow child (cost=0.00..28,442.77 rows=40,957 width=4) (actual rows=32,828 loops=1)

  • Filter: ((modified > (now() - '1 day'::interval)) OR (next_activation IS NOT NULL))
  • Rows Removed by Filter: 559552
  • Buffers: shared hit=18187
Total runtime : 8,986.890 ms