explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2ndj

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 1,953.596 ↓ 0.0 0 1

Sort (cost=5,682.06..5,682.08 rows=5 width=458) (actual time=1,953.596..1,953.596 rows=0 loops=1)

  • Sort Key: psfv.field_display_order, psfv.option_display_order
  • Sort Method: quicksort Memory: 25kB
2. 0.000 1,953.589 ↓ 0.0 0 1

Subquery Scan on psfv (cost=5,681.39..5,682.01 rows=5 width=458) (actual time=1,953.589..1,953.589 rows=0 loops=1)

3. 0.001 1,953.589 ↓ 0.0 0 1

Unique (cost=5,681.39..5,681.86 rows=5 width=1,178) (actual time=1,953.589..1,953.589 rows=0 loops=1)

4. 0.093 1,953.588 ↓ 0.0 0 1

Sort (cost=5,681.39..5,681.41 rows=5 width=1,178) (actual time=1,953.588..1,953.588 rows=0 loops=1)

  • Sort Key: "*SELECT* 1".mr_no, "*SELECT* 1".patient_id, "*SELECT* 1".section_item_id, "*SELECT* 1".lableforyes, "*SELECT* 1".lableforno, "*SELECT* 1".generic_form_id, "*SELECT* 1".section_status, "*SELECT* 1".section_id, "*SELECT* 1".form_id, "*SELECT* 1".item_type, "*SELECT* 1".form_type, "*SELECT* 1".section_detail_id, "*SELECT* 1".finalized, "*SELECT* 1".finalized_user, "*SELECT* 1".linked_to, "*SELECT* 1".field_id, "*SELECT* 1".option_id, "*SELECT* 1".option_value, "*SELECT* 1".option_remarks, "*SELECT* 1".date_time, "*SELECT* 1".option_display_order, "*SELECT* 1".field_name, "*SELECT* 1".field_type, "*SELECT* 1".allow_others, "*SELECT* 1".allow_normal, "*SELECT* 1".normal_text, "*SELECT* 1".section_title, "*SELECT* 1".field_display_order, ((0)::numeric), ((0)::numeric), (0), (''::character varying), "*SELECT* 1".available, "*SELECT* 1".temp_username, "*SELECT* 1".allow_negative, (''::text)
  • Sort Method: quicksort Memory: 25kB
5. 0.001 1,953.495 ↓ 0.0 0 1

Append (cost=2,404.23..5,681.34 rows=5 width=1,178) (actual time=1,953.495..1,953.495 rows=0 loops=1)

6. 0.001 1,831.834 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=2,404.23..3,262.89 rows=4 width=343) (actual time=1,831.834..1,831.834 rows=0 loops=1)

7. 0.000 1,831.833 ↓ 0.0 0 1

Nested Loop Left Join (cost=2,404.23..3,262.75 rows=4 width=287) (actual time=1,831.833..1,831.833 rows=0 loops=1)

8. 0.001 1,831.833 ↓ 0.0 0 1

Nested Loop (cost=2,403.94..3,256.69 rows=4 width=192) (actual time=1,831.833..1,831.833 rows=0 loops=1)

9. 0.002 1,831.832 ↓ 0.0 0 1

Nested Loop (cost=2,403.66..3,250.67 rows=4 width=154) (actual time=1,831.832..1,831.832 rows=0 loops=1)

  • Join Filter: (psd.section_detail_id = v.section_detail_id)
10. 0.002 1,831.810 ↑ 1.0 1 1

Nested Loop Left Join (cost=2,403.08..2,417.30 rows=1 width=133) (actual time=1,831.809..1,831.810 rows=1 loops=1)

11. 0.002 1,831.807 ↑ 1.0 1 1

Nested Loop (cost=2,402.80..2,412.97 rows=1 width=114) (actual time=1,831.806..1,831.807 rows=1 loops=1)

12. 0.004 1,831.775 ↑ 1.0 1 1

Nested Loop (cost=2,402.52..2,408.63 rows=1 width=80) (actual time=1,831.775..1,831.775 rows=1 loops=1)

13. 0.363 1,831.737 ↑ 1.0 1 1

Bitmap Heap Scan on patient_section_details psd (cost=2,401.95..2,403.99 rows=1 width=63) (actual time=1,831.736..1,831.737 rows=1 loops=1)

  • Recheck Cond: (((mr_no)::text = 'UL0300000321641'::text) AND (section_id = 349))
  • Filter: (section_status = 'A'::bpchar)
  • Rows Removed by Filter: 3
  • Heap Blocks: exact=6
14. 2.570 1,831.374 ↓ 0.0 0 1

BitmapAnd (cost=2,401.95..2,401.95 rows=1 width=0) (actual time=1,831.374..1,831.374 rows=0 loops=1)

15. 3.309 3.309 ↑ 1.5 1,111 1

Bitmap Index Scan on patient_section_details_mr_no_idx (cost=0.00..33.32 rows=1,700 width=0) (actual time=3.308..3.309 rows=1,111 loops=1)

  • Index Cond: ((mr_no)::text = 'UL0300000321641'::text)
16. 1,825.495 1,825.495 ↓ 3.7 436,597 1

Bitmap Index Scan on psd_section_id_idx (cost=0.00..2,368.38 rows=118,108 width=0) (actual time=1,825.495..1,825.495 rows=436,597 loops=1)

  • Index Cond: (section_id = 349)
17. 0.034 0.034 ↑ 1.0 1 1

Index Scan using psf_section_detail_id_idx on patient_section_forms psf (cost=0.57..4.61 rows=1 width=17) (actual time=0.034..0.034 rows=1 loops=1)

  • Index Cond: (section_detail_id = psd.section_detail_id)
18. 0.030 0.030 ↑ 1.0 1 1

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

  • Index Cond: (section_id = 349)
  • Filter: ((linked_to)::text = 'patient'::text)
19. 0.001 0.001 ↓ 0.0 0 1

Index Scan using u_user_pk on u_user usr (cost=0.29..4.32 rows=1 width=27) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: ((psd.finalized_user)::text = (emp_username)::text)
20. 0.020 0.020 ↓ 0.0 0 1

Index Scan using ppfv_form_detail_id on patient_section_values v (cost=0.57..571.74 rows=8,050 width=29) (actual time=0.020..0.020 rows=0 loops=1)

  • Index Cond: (section_detail_id = psf.section_detail_id)
  • Filter: (available = 'Y'::bpchar)
21. 0.000 0.000 ↓ 0.0 0

Index Scan using sfd_field_id_idx on section_field_desc sfd (cost=0.28..1.51 rows=1 width=42) (never executed)

  • Index Cond: (field_id = v.field_id)
22. 0.000 0.000 ↓ 0.0 0

Index Scan using physician_form_field_options_pkey on section_field_options o (cost=0.29..1.52 rows=1 width=23) (never executed)

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

Nested Loop Left Join (cost=2,403.80..2,418.41 rows=1 width=272) (actual time=121.660..121.660 rows=0 loops=1)

24. 0.000 121.659 ↓ 0.0 0 1

Nested Loop (cost=2,403.51..2,414.09 rows=1 width=173) (actual time=121.659..121.659 rows=0 loops=1)

25. 0.001 121.659 ↓ 0.0 0 1

Nested Loop (cost=2,403.23..2,413.77 rows=1 width=135) (actual time=121.659..121.659 rows=0 loops=1)

26. 0.001 121.658 ↓ 0.0 0 1

Nested Loop (cost=2,402.95..2,409.42 rows=1 width=101) (actual time=121.658..121.658 rows=0 loops=1)

  • Join Filter: (psd_1.section_detail_id = img.section_detail_id)
27. 0.003 121.610 ↑ 1.0 1 1

Nested Loop (cost=2,402.52..2,408.63 rows=1 width=80) (actual time=121.609..121.610 rows=1 loops=1)

28. 0.020 121.589 ↑ 1.0 1 1

Bitmap Heap Scan on patient_section_details psd_1 (cost=2,401.95..2,403.99 rows=1 width=63) (actual time=121.588..121.589 rows=1 loops=1)

  • Recheck Cond: (((mr_no)::text = 'UL0300000321641'::text) AND (section_id = 349))
  • Filter: (section_status = 'A'::bpchar)
  • Rows Removed by Filter: 3
  • Heap Blocks: exact=6
29. 2.929 121.569 ↓ 0.0 0 1

BitmapAnd (cost=2,401.95..2,401.95 rows=1 width=0) (actual time=121.569..121.569 rows=0 loops=1)

30. 0.086 0.086 ↑ 1.5 1,111 1

Bitmap Index Scan on patient_section_details_mr_no_idx (cost=0.00..33.32 rows=1,700 width=0) (actual time=0.086..0.086 rows=1,111 loops=1)

  • Index Cond: ((mr_no)::text = 'UL0300000321641'::text)
31. 118.554 118.554 ↓ 3.7 436,597 1

Bitmap Index Scan on psd_section_id_idx (cost=0.00..2,368.38 rows=118,108 width=0) (actual time=118.554..118.554 rows=436,597 loops=1)

  • Index Cond: (section_id = 349)
32. 0.018 0.018 ↑ 1.0 1 1

Index Scan using psf_section_detail_id_idx on patient_section_forms psf_1 (cost=0.57..4.61 rows=1 width=17) (actual time=0.017..0.018 rows=1 loops=1)

  • Index Cond: (section_detail_id = psd_1.section_detail_id)
33. 0.047 0.047 ↓ 0.0 0 1

Index Scan using ppfg_form_detail_id on patient_section_image_details img (cost=0.43..0.63 rows=5 width=29) (actual time=0.047..0.047 rows=0 loops=1)

  • Index Cond: (section_detail_id = psf_1.section_detail_id)
  • Filter: (available = 'Y'::bpchar)
34. 0.000 0.000 ↓ 0.0 0

Index Scan using physician_form_desc_pkey on section_master sm_1 (cost=0.28..4.32 rows=1 width=38) (never executed)

  • Index Cond: (section_id = 349)
  • Filter: ((linked_to)::text = 'patient'::text)
35. 0.000 0.000 ↓ 0.0 0

Index Scan using sfd_field_id_idx on section_field_desc sfd_1 (cost=0.28..0.32 rows=1 width=42) (never executed)

  • Index Cond: (field_id = img.field_id)
36. 0.000 0.000 ↓ 0.0 0

Index Scan using u_user_pk on u_user usr_1 (cost=0.29..4.32 rows=1 width=27) (never executed)

  • Index Cond: ((psd_1.finalized_user)::text = (emp_username)::text)
Planning time : 11.167 ms
Execution time : 1,954.060 ms