explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Znn6

Settings
# exclusive inclusive rows x rows loops node
1. 786.756 16,296.431 ↓ 1.3 458,642 1

Merge Anti Join (cost=8,868,544.32..8,870,605.05 rows=340,121 width=186) (actual time=15,215.928..16,296.431 rows=458,642 loops=1)

  • Merge Cond: (parent.id = child.root_workflow_id)
  • Buffers: shared hit=3783823 read=7039
2. 1,819.386 14,471.079 ↓ 1.3 468,886 1

Sort (cost=8,836,741.33..8,837,653.23 rows=364,759 width=190) (actual time=14,172.875..14,471.079 rows=468,886 loops=1)

  • Sort Key: parent.id
  • Sort Method: quicksort Memory: 136836kB
  • Buffers: shared hit=3765636 read=7039
3. 2,214.265 12,651.693 ↓ 1.3 468,886 1

Nested Loop (cost=6.82..8,803,043.83 rows=364,759 width=190) (actual time=0.177..12,651.693 rows=468,886 loops=1)

  • Buffers: shared hit=3765636 read=7039
4. 364.741 364.741 ↑ 1.0 592,511 1

Seq Scan on nflow_workflow w (cost=0.00..24,112.27 rows=592,527 width=186) (actual time=0.012..364.741 rows=592,511 loops=1)

  • Buffers: shared hit=18187
5. 2,962.555 10,072.687 ↑ 1.0 1 592,511

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

  • 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=3747449 read=7039
6. 1,185.022 7,110.132 ↓ 0.0 0 592,511

BitmapOr (cost=6.82..6.82 rows=2 width=0) (actual time=0.012..0.012 rows=0 loops=592,511)

  • Buffers: shared hit=2818306 read=7039
7. 3,555.066 3,555.066 ↑ 1.0 1 592,511

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

  • Index Cond: (id = w.id)
  • Buffers: shared hit=1780681 read=6069
8. 2,370.044 2,370.044 ↑ 1.0 1 592,511

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

  • Index Cond: (id = w.root_workflow_id)
  • Buffers: shared hit=1037625 read=970
9. 23.513 1,038.596 ↑ 3.7 11,401 1

Sort (cost=31,768.66..31,873.28 rows=41,848 width=4) (actual time=1,034.070..1,038.596 rows=11,401 loops=1)

  • Sort Key: child.root_workflow_id
  • Sort Method: quicksort Memory: 2874kB
  • Buffers: shared hit=18187
10. 1,015.083 1,015.083 ↑ 1.3 32,959 1

Seq Scan on nflow_workflow child (cost=0.00..28,556.22 rows=41,848 width=4) (actual time=0.043..1,015.083 rows=32,959 loops=1)

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