explain.depesz.com

PostgreSQL's explain analyze made readable

Result: C8XJ

Settings
# exclusive inclusive rows x rows loops node
1. 337.846 7,806.438 ↓ 1.3 407,432 1

Merge Anti Join (cost=8,033,455.20..8,035,275.25 rows=309,076 width=186) (actual time=7,323.261..7,806.438 rows=407,432 loops=1)

  • Merge Cond: (parent.id = child.root_workflow_id)
  • Buffers: shared hit=3453229 read=6933
2. 1,072.897 7,014.550 ↓ 1.3 415,352 1

Sort (cost=8,003,494.50..8,004,315.41 rows=328,365 width=190) (actual time=6,871.325..7,014.550 rows=415,352 loops=1)

  • Sort Key: parent.id
  • Sort Method: quicksort Memory: 122616kB
  • Buffers: shared hit=3435042 read=6933
3. 920.157 5,941.653 ↓ 1.3 415,352 1

Nested Loop (cost=6.82..7,973,408.15 rows=328,365 width=190) (actual time=0.227..5,941.653 rows=415,352 loops=1)

  • Buffers: shared hit=3435039 read=6933
4. 195.732 195.732 ↑ 1.0 536,196 1

Seq Scan on nflow_workflow w (cost=0.00..23,552.51 rows=536,551 width=186) (actual time=0.007..195.732 rows=536,196 loops=1)

  • Buffers: shared hit=18187
5. 1,608.588 4,825.764 ↑ 1.0 1 536,196

Bitmap Heap Scan on nflow_workflow parent (cost=6.82..14.81 rows=1 width=4) (actual time=0.009..0.009 rows=1 loops=536,196)

  • 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=3416852 read=6933
6. 536.196 3,217.176 ↓ 0.0 0 536,196

BitmapOr (cost=6.82..6.82 rows=2 width=0) (actual time=0.006..0.006 rows=0 loops=536,196)

  • Buffers: shared hit=2568192 read=6933
7. 1,608.588 1,608.588 ↑ 1.0 1 536,196

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=536,196)

  • Index Cond: (id = w.id)
  • Buffers: shared hit=1611278 read=6075
8. 1,072.392 1,072.392 ↑ 1.0 1 536,196

Bitmap Index Scan on nflow_workflow_pkey (cost=0.00..3.41 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=536,196)

  • Index Cond: (id = w.root_workflow_id)
  • Buffers: shared hit=956914 read=858
9. 17.187 454.042 ↑ 3.3 9,600 1

Sort (cost=29,931.65..30,010.44 rows=31,518 width=4) (actual time=451.365..454.042 rows=9,600 loops=1)

  • Sort Key: child.root_workflow_id
  • Sort Method: quicksort Memory: 1809kB
  • Buffers: shared hit=18187
10. 436.855 436.855 ↑ 1.2 25,688 1

Seq Scan on nflow_workflow child (cost=0.00..27,576.64 rows=31,518 width=4) (actual time=0.031..436.855 rows=25,688 loops=1)

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