explain.depesz.com

PostgreSQL's explain analyze made readable

Result: M7kr

Settings
# exclusive inclusive rows x rows loops node
1. 0.016 168.950 ↑ 2.0 2 1

Sort (cost=130,478.41..130,478.42 rows=4 width=426) (actual time=168.950..168.950 rows=2 loops=1)

  • Sort Key: psfv.section_detail_id, psfv.section_id, psfv.field_display_order, psfv.option_display_order
  • Sort Method: quicksort Memory: 25kB
2. 0.001 168.934 ↑ 2.0 2 1

Subquery Scan on psfv (cost=1,001.27..130,478.37 rows=4 width=426) (actual time=168.883..168.934 rows=2 loops=1)

3. 0.001 168.933 ↑ 2.0 2 1

Append (cost=1,001.27..130,478.25 rows=4 width=620) (actual time=168.882..168.933 rows=2 loops=1)

4. 0.000 168.931 ↑ 1.5 2 1

Subquery Scan on *SELECT* 1 (cost=1,001.27..130,478.25 rows=3 width=262) (actual time=168.881..168.931 rows=2 loops=1)

5. 22.528 183.092 ↑ 1.5 2 1

Gather (cost=1,001.27..130,478.15 rows=3 width=206) (actual time=168.879..183.092 rows=2 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 0.000 160.564 ↑ 1.0 1 3

Nested Loop Left Join (cost=1.27..129,477.85 rows=1 width=206) (actual time=160.561..160.564 rows=1 loops=3)

7. 0.000 160.555 ↑ 1.0 1 3

Nested Loop (cost=0.99..129,473.53 rows=1 width=111) (actual time=160.552..160.555 rows=1 loops=3)

8. 0.000 160.544 ↑ 1.0 1 3

Nested Loop (cost=0.71..129,469.20 rows=1 width=77) (actual time=160.541..160.544 rows=1 loops=3)

9. 0.000 160.532 ↑ 1.0 1 3

Nested Loop (cost=0.43..129,468.89 rows=1 width=43) (actual time=160.531..160.532 rows=1 loops=3)

10. 160.508 160.508 ↑ 2.0 1 3

Parallel Seq Scan on patient_dynamic_section_values v (cost=0.00..129,459.95 rows=2 width=37) (actual time=160.507..160.508 rows=1 loops=3)

  • Filter: (prescription_id = 22146140)
  • Rows Removed by Filter: 1807738
11. 0.033 0.033 ↑ 1.0 1 2

Index Scan using patient_dynamic_section_details_pkey on patient_dynamic_section_details psd (cost=0.43..4.47 rows=1 width=10) (actual time=0.033..0.033 rows=1 loops=2)

  • Index Cond: (section_detail_id = v.section_detail_id)
  • Filter: (visit_type = 'o'::text)
12. 0.015 0.015 ↑ 1.0 1 2

Index Scan using physician_form_desc_pkey on section_master sm (cost=0.28..0.32 rows=1 width=38) (actual time=0.015..0.015 rows=1 loops=2)

  • Index Cond: (section_id = psd.section_id)
13. 0.015 0.015 ↑ 1.0 1 2

Index Scan using sfd_field_id_idx on section_field_desc sfd (cost=0.28..4.32 rows=1 width=38) (actual time=0.015..0.015 rows=1 loops=2)

  • Index Cond: (field_id = v.field_id)
14. 0.010 0.010 ↓ 0.0 0 2

Index Scan using sfo_option_id_idx on section_field_options o (cost=0.29..4.32 rows=1 width=23) (actual time=0.010..0.010 rows=0 loops=2)

  • Index Cond: (v.option_id = option_id)
15. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=187) (actual time=0.000..0.001 rows=0 loops=1)

  • One-Time Filter: false
Planning time : 2.951 ms
Execution time : 183.307 ms