explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cUAw : Optimization for: plan #4ZZ3

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 345,648.502 514,950.483 ↓ 507.4 73,376,114 1

Gather Merge (cost=3,517,140.21..3,534,014.18 rows=144,624 width=127) (actual time=459,937.084..514,950.483 rows=73,376,114 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=17,762,693 read=837,119, temp read=2,767,678 written=2,768,532
2. 82,569.391 169,301.981 ↓ 338.2 24,458,705 3 / 3

Sort (cost=3,516,140.18..3,516,320.96 rows=72,312 width=127) (actual time=157,340.445..169,301.981 rows=24,458,705 loops=3)

  • Sort Key: ff.id, ffvb.id
  • Sort Method: external merge Disk: 8,511,296kB
  • Buffers: shared hit=17,762,693 read=837,119, temp read=2,767,678 written=2,768,532
3. 8,788.461 86,732.590 ↓ 338.2 24,458,705 3 / 3

Nested Loop (cost=7,816.25..3,510,303.9 rows=72,312 width=127) (actual time=114.768..86,732.59 rows=24,458,705 loops=3)

  • Buffers: shared hit=17,762,679 read=837,119
4. 0.744 118.195 ↑ 1.3 62 3 / 3

Nested Loop (cost=7,815.67..8,259.8 rows=78 width=136) (actual time=114.562..118.195 rows=62 loops=3)

  • Buffers: shared hit=7,549 read=2
5. 0.470 114.847 ↑ 1.3 62 3 / 3

Merge Join (cost=7,815.25..7,818.72 rows=78 width=78) (actual time=114.273..114.847 rows=62 loops=3)

  • Buffers: shared hit=6,796
6. 0.401 112.354 ↑ 1.3 62 3 / 3

Sort (cost=7,768.19..7,768.38 rows=78 width=82) (actual time=112.209..112.354 rows=62 loops=3)

  • Sort Key: ff.form_id
  • Sort Method: quicksort Memory: 50kB
  • Buffers: shared hit=6,730
7. 50.114 111.953 ↑ 1.3 62 3 / 3

Hash Join (cost=82.92..7,765.73 rows=78 width=82) (actual time=14.989..111.953 rows=62 loops=3)

  • Buffers: shared hit=6,709
8. 59.100 59.100 ↑ 1.1 67,523 3 / 3

Seq Scan on form_field ff (cost=0..7,234.33 rows=71,633 width=76) (actual time=0.039..59.1 rows=67,523 loops=3)

  • Buffers: shared hit=6,518
9. 0.212 2.739 ↑ 1.0 186 3 / 3

Hash (cost=80.6..80.6 rows=186 width=14) (actual time=2.738..2.739 rows=186 loops=3)

  • Buffers: shared hit=126
10. 2.527 2.527 ↑ 1.0 186 3 / 3

Seq Scan on form_field_value_bup ffvb (cost=0..80.6 rows=186 width=14) (actual time=0.36..2.527 rows=186 loops=3)

  • Filter: ((ffvb.value)::text <> '0'::text)
  • Buffers: shared hit=126
11. 0.546 2.023 ↑ 5.7 81 3 / 3

Sort (cost=47.07..48.22 rows=462 width=4) (actual time=2.011..2.023 rows=81 loops=3)

  • Sort Key: f.id
  • Sort Method: quicksort Memory: 47kB
  • Buffers: shared hit=66
12. 1.477 1.477 ↓ 1.0 470 3 / 3

Seq Scan on form f (cost=0..26.62 rows=462 width=4) (actual time=0.75..1.477 rows=470 loops=3)

  • Buffers: shared hit=66
13. 2.604 2.604 ↑ 1.0 1 186 / 3

Index Scan using form_section_pkey on form_section fs2 (cost=0.42..5.65 rows=1 width=58) (actual time=0.042..0.042 rows=1 loops=186)

  • Index Cond: (fs2.id = ff.form_section_id)
  • Buffers: shared hit=753 read=2
14. 77,825.934 77,825.934 ↓ 15.6 394,495 186 / 3

Index Scan using fk_form_field_value_form_section1 on form_field_value ffv (cost=0.58..44,645.86 rows=25,214 width=11) (actual time=0.344..1,255.257 rows=394,495 loops=186)

  • Index Cond: (ffv.form_section_id = fs2.id)
  • Filter: (ffv.value <> '0'::text)
  • Buffers: shared hit=17,755,130 read=837,117
Planning time : 269.714 ms
Execution time : 527,005.106 ms