explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VbKE

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 59,775.150 ↑ 1.2 12 1

Limit (cost=6,266,759.81..6,266,759.85 rows=15 width=344) (actual time=59,775.147..59,775.150 rows=12 loops=1)

2. 0.045 59,775.147 ↑ 1.2 12 1

Sort (cost=6,266,759.81..6,266,759.85 rows=15 width=344) (actual time=59,775.146..59,775.147 rows=12 loops=1)

  • Sort Key: psdal.log_id
  • Sort Method: quicksort Memory: 28kB
3. 0.015 59,775.102 ↑ 1.2 12 1

Append (cost=65.49..6,266,759.37 rows=15 width=108) (actual time=0.742..59,775.102 rows=12 loops=1)

4. 0.057 0.800 ↓ 3.0 3 1

Nested Loop (cost=65.49..77.55 rows=1 width=73) (actual time=0.742..0.800 rows=3 loops=1)

5. 0.144 0.311 ↓ 108.0 108 1

Bitmap Heap Scan on patient_section_details_audit_log psdal (cost=64.93..68.95 rows=1 width=77) (actual time=0.187..0.311 rows=108 loops=1)

  • Recheck Cond: (((patient_id)::text = 'LCRCOP000804'::text) AND ((mr_no)::text = 'LCRC00000207'::text))
  • Filter: ((section_item_id)::text = '1207048'::text)
  • Rows Removed by Filter: 3
6. 0.003 0.167 ↓ 0.0 0 1

BitmapAnd (cost=64.93..64.93 rows=1 width=0) (actual time=0.167..0.167 rows=0 loops=1)

7. 0.084 0.084 ↑ 7.4 111 1

Bitmap Index Scan on patient_section_details_audit_log_patient_id_idx (cost=0.00..26.74 rows=823 width=0) (actual time=0.084..0.084 rows=111 loops=1)

  • Index Cond: ((patient_id)::text = 'LCRCOP000804'::text)
8. 0.080 0.080 ↑ 5.7 219 1

Bitmap Index Scan on patient_section_details_audit_log_mr_no_idx (cost=0.00..37.94 rows=1,250 width=0) (actual time=0.080..0.080 rows=219 loops=1)

  • Index Cond: ((mr_no)::text = 'LCRC00000207'::text)
9. 0.432 0.432 ↓ 0.0 0 108

Index Scan using patient_section_details_pkey on patient_section_details psd (cost=0.56..8.59 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=108)

  • Index Cond: (section_detail_id = psdal.section_detail_id)
  • Filter: (section_id = (-7))
  • Rows Removed by Filter: 1
10. 0.002 4,542.521 ↓ 3.0 3 1

Subquery Scan on *SELECT* 2 (cost=366,649.95..526,192.24 rows=1 width=79) (actual time=3,231.441..4,542.521 rows=3 loops=1)

11. 110.273 4,542.519 ↓ 3.0 3 1

Hash Join (cost=366,649.95..526,192.23 rows=1 width=79) (actual time=3,231.440..4,542.519 rows=3 loops=1)

  • Hash Cond: (ptpal.op_test_pres_id = ppal.patient_presc_id)
12. 1,633.787 1,633.787 ↓ 1.0 1,182,076 1

Seq Scan on patient_test_prescriptions_audit_log ptpal (cost=0.00..155,149.77 rows=1,171,330 width=56) (actual time=0.033..1,633.787 rows=1,182,076 loops=1)

  • Filter: (((operation)::text = 'INSERT'::text) AND ((field_name)::text = 'op_test_pres_id'::text))
  • Rows Removed by Filter: 4429665
13. 0.006 2,798.459 ↓ 9.0 9 1

Hash (cost=366,649.93..366,649.93 rows=1 width=27) (actual time=2,798.459..2,798.459 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
14. 0.023 2,798.453 ↓ 9.0 9 1

Nested Loop (cost=0.43..366,649.93 rows=1 width=27) (actual time=134.216..2,798.453 rows=9 loops=1)

  • Join Filter: (ppal.consultation_id = dc.consultation_id)
15. 0.052 0.052 ↑ 1.0 1 1

Index Scan using doctor_consultation_patient_id_idx on doctor_consultation dc (cost=0.43..8.45 rows=1 width=23) (actual time=0.049..0.052 rows=1 loops=1)

  • Index Cond: ((patient_id)::text = 'LCRCOP000804'::text)
  • Filter: ((mr_no)::text = 'LCRC00000207'::text)
16. 2,798.378 2,798.378 ↑ 1,295.3 9 1

Seq Scan on patient_prescription_audit_log ppal (cost=0.00..366,495.76 rows=11,658 width=8) (actual time=134.148..2,798.378 rows=9 loops=1)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
  • Rows Removed by Filter: 10993508
17. 0.000 1,153.219 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3 (cost=0.43..521,797.52 rows=1 width=79) (actual time=1,153.219..1,153.219 rows=0 loops=1)

18. 0.001 1,153.219 ↓ 0.0 0 1

Nested Loop (cost=0.43..521,797.51 rows=1 width=79) (actual time=1,153.219..1,153.219 rows=0 loops=1)

19. 0.002 1,153.218 ↓ 0.0 0 1

Nested Loop (cost=0.00..521,791.26 rows=1 width=60) (actual time=1,153.218..1,153.218 rows=0 loops=1)

  • Join Filter: (ptpal_1.op_test_pres_id = ppal_1.patient_presc_id)
20. 1,153.216 1,153.216 ↓ 0.0 0 1

Seq Scan on patient_test_prescriptions_audit_log ptpal_1 (cost=0.00..155,149.77 rows=1 width=56) (actual time=1,153.216..1,153.216 rows=0 loops=1)

  • Filter: (((operation)::text = 'ChangeLog'::text) AND ((field_name)::text = 'op_test_pres_id'::text))
  • Rows Removed by Filter: 5611741
21. 0.000 0.000 ↓ 0.0 0

Seq Scan on patient_prescription_audit_log ppal_1 (cost=0.00..366,495.76 rows=11,658 width=8) (never executed)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
22. 0.000 0.000 ↓ 0.0 0

Index Scan using doctor_consultation_pkey on doctor_consultation dc_1 (cost=0.43..6.24 rows=1 width=23) (never executed)

  • Index Cond: (consultation_id = ppal_1.consultation_id)
  • Filter: (((patient_id)::text = 'LCRCOP000804'::text) AND ((mr_no)::text = 'LCRC00000207'::text))
23. 0.002 5,474.277 ↑ 1.0 1 1

Subquery Scan on *SELECT* 4 (cost=0.43..397,836.89 rows=1 width=86) (actual time=1,977.627..5,474.277 rows=1 loops=1)

24. 227.516 5,474.275 ↑ 1.0 1 1

Nested Loop (cost=0.43..397,836.88 rows=1 width=86) (actual time=1,977.626..5,474.275 rows=1 loops=1)

  • Join Filter: (ppal_2.patient_presc_id = pspal.op_service_pres_id)
  • Rows Removed by Join Filter: 1773323
25. 0.036 2,653.832 ↓ 9.0 9 1

Nested Loop (cost=0.43..366,649.93 rows=1 width=27) (actual time=104.687..2,653.832 rows=9 loops=1)

  • Join Filter: (ppal_2.consultation_id = dc_2.consultation_id)
26. 0.046 0.046 ↑ 1.0 1 1

Index Scan using doctor_consultation_patient_id_idx on doctor_consultation dc_2 (cost=0.43..8.45 rows=1 width=23) (actual time=0.043..0.046 rows=1 loops=1)

  • Index Cond: ((patient_id)::text = 'LCRCOP000804'::text)
  • Filter: ((mr_no)::text = 'LCRC00000207'::text)
27. 2,653.750 2,653.750 ↑ 1,295.3 9 1

Seq Scan on patient_prescription_audit_log ppal_2 (cost=0.00..366,495.76 rows=11,658 width=8) (actual time=104.623..2,653.750 rows=9 loops=1)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
  • Rows Removed by Filter: 10993508
28. 2,592.927 2,592.927 ↓ 1.0 197,036 9

Seq Scan on patient_service_prescriptions_audit_log pspal (cost=0.00..28,786.10 rows=192,068 width=63) (actual time=0.006..288.103 rows=197,036 loops=9)

  • Filter: (((operation)::text = 'INSERT'::text) AND ((field_name)::text = 'op_service_pres_id'::text))
  • Rows Removed by Filter: 837007
29. 0.001 198.447 ↓ 0.0 0 1

Subquery Scan on *SELECT* 5 (cost=0.43..395,433.85 rows=1 width=86) (actual time=198.447..198.447 rows=0 loops=1)

30. 0.001 198.446 ↓ 0.0 0 1

Nested Loop (cost=0.43..395,433.84 rows=1 width=86) (actual time=198.446..198.446 rows=0 loops=1)

31. 0.001 198.445 ↓ 0.0 0 1

Nested Loop (cost=0.00..395,427.58 rows=1 width=67) (actual time=198.445..198.445 rows=0 loops=1)

  • Join Filter: (pspal_1.op_service_pres_id = ppal_3.patient_presc_id)
32. 198.444 198.444 ↓ 0.0 0 1

Seq Scan on patient_service_prescriptions_audit_log pspal_1 (cost=0.00..28,786.10 rows=1 width=63) (actual time=198.444..198.444 rows=0 loops=1)

  • Filter: (((operation)::text = 'ChangeLog'::text) AND ((field_name)::text = 'op_service_pres_id'::text))
  • Rows Removed by Filter: 1034043
33. 0.000 0.000 ↓ 0.0 0

Seq Scan on patient_prescription_audit_log ppal_3 (cost=0.00..366,495.76 rows=11,658 width=8) (never executed)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
34. 0.000 0.000 ↓ 0.0 0

Index Scan using doctor_consultation_pkey on doctor_consultation dc_3 (cost=0.43..6.24 rows=1 width=23) (never executed)

  • Index Cond: (consultation_id = ppal_3.consultation_id)
  • Filter: (((patient_id)::text = 'LCRCOP000804'::text) AND ((mr_no)::text = 'LCRC00000207'::text))
35. 0.000 3,512.403 ↓ 0.0 0 1

Subquery Scan on *SELECT* 6 (cost=0.43..376,246.56 rows=1 width=135) (actual time=3,512.403..3,512.403 rows=0 loops=1)

36. 129.456 3,512.403 ↓ 0.0 0 1

Nested Loop (cost=0.43..376,246.55 rows=1 width=135) (actual time=3,512.403..3,512.403 rows=0 loops=1)

  • Join Filter: (ppal_4.patient_presc_id = pcpal.prescription_id)
  • Rows Removed by Join Filter: 999873
37. 0.033 2,580.966 ↓ 9.0 9 1

Nested Loop (cost=0.43..366,649.93 rows=1 width=27) (actual time=108.266..2,580.966 rows=9 loops=1)

  • Join Filter: (ppal_4.consultation_id = dc_4.consultation_id)
38. 0.034 0.034 ↑ 1.0 1 1

Index Scan using doctor_consultation_patient_id_idx on doctor_consultation dc_4 (cost=0.43..8.45 rows=1 width=23) (actual time=0.032..0.034 rows=1 loops=1)

  • Index Cond: ((patient_id)::text = 'LCRCOP000804'::text)
  • Filter: ((mr_no)::text = 'LCRC00000207'::text)
39. 2,580.899 2,580.899 ↑ 1,295.3 9 1

Seq Scan on patient_prescription_audit_log ppal_4 (cost=0.00..366,495.76 rows=11,658 width=8) (actual time=108.215..2,580.899 rows=9 loops=1)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
  • Rows Removed by Filter: 10993508
40. 801.981 801.981 ↑ 1.0 111,097 9

Seq Scan on patient_consultation_prescriptions_audit_log pcpal (cost=0.00..8,205.30 rows=111,306 width=112) (actual time=0.006..89.109 rows=111,097 loops=9)

  • Filter: (((operation)::text = 'INSERT'::text) AND ((field_name)::text = 'prescription_id'::text))
  • Rows Removed by Filter: 179426
41. 0.000 53.696 ↓ 0.0 0 1

Subquery Scan on *SELECT* 7 (cost=0.43..374,853.04 rows=1 width=135) (actual time=53.696..53.696 rows=0 loops=1)

42. 0.001 53.696 ↓ 0.0 0 1

Nested Loop (cost=0.43..374,853.03 rows=1 width=135) (actual time=53.696..53.696 rows=0 loops=1)

43. 0.001 53.695 ↓ 0.0 0 1

Nested Loop (cost=0.00..374,846.78 rows=1 width=116) (actual time=53.695..53.695 rows=0 loops=1)

  • Join Filter: (pcpal_1.prescription_id = ppal_5.patient_presc_id)
44. 53.694 53.694 ↓ 0.0 0 1

Seq Scan on patient_consultation_prescriptions_audit_log pcpal_1 (cost=0.00..8,205.30 rows=1 width=112) (actual time=53.694..53.694 rows=0 loops=1)

  • Filter: (((operation)::text = 'ChangeLog'::text) AND ((field_name)::text = 'prescription_id'::text))
  • Rows Removed by Filter: 290523
45. 0.000 0.000 ↓ 0.0 0

Seq Scan on patient_prescription_audit_log ppal_5 (cost=0.00..366,495.76 rows=11,658 width=8) (never executed)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
46. 0.000 0.000 ↓ 0.0 0

Index Scan using doctor_consultation_pkey on doctor_consultation dc_5 (cost=0.43..6.24 rows=1 width=23) (never executed)

  • Index Cond: (consultation_id = ppal_5.consultation_id)
  • Filter: (((patient_id)::text = 'LCRCOP000804'::text) AND ((mr_no)::text = 'LCRC00000207'::text))
47. 0.000 2,557.437 ↓ 0.0 0 1

Subquery Scan on *SELECT* 8 (cost=0.43..366,651.88 rows=1 width=111) (actual time=2,557.437..2,557.437 rows=0 loops=1)

48. 0.032 2,557.437 ↓ 0.0 0 1

Nested Loop (cost=0.43..366,651.87 rows=1 width=111) (actual time=2,557.437..2,557.437 rows=0 loops=1)

  • Join Filter: (ppal_6.patient_presc_id = popal.prescription_id)
  • Rows Removed by Join Filter: 144
49. 0.023 2,557.270 ↓ 9.0 9 1

Nested Loop (cost=0.43..366,649.93 rows=1 width=27) (actual time=107.725..2,557.270 rows=9 loops=1)

  • Join Filter: (ppal_6.consultation_id = dc_6.consultation_id)
50. 0.055 0.055 ↑ 1.0 1 1

Index Scan using doctor_consultation_patient_id_idx on doctor_consultation dc_6 (cost=0.43..8.45 rows=1 width=23) (actual time=0.052..0.055 rows=1 loops=1)

  • Index Cond: ((patient_id)::text = 'LCRCOP000804'::text)
  • Filter: ((mr_no)::text = 'LCRC00000207'::text)
51. 2,557.192 2,557.192 ↑ 1,295.3 9 1

Seq Scan on patient_prescription_audit_log ppal_6 (cost=0.00..366,495.76 rows=11,658 width=8) (actual time=107.653..2,557.192 rows=9 loops=1)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
  • Rows Removed by Filter: 10993508
52. 0.135 0.135 ↑ 1.0 16 9

Seq Scan on patient_operation_prescriptions_audit_log popal (cost=0.00..1.73 rows=16 width=88) (actual time=0.003..0.015 rows=16 loops=9)

  • Filter: (((operation)::text = 'INSERT'::text) AND ((field_name)::text = 'prescription_id'::text))
  • Rows Removed by Filter: 33
53. 0.001 0.027 ↓ 0.0 0 1

Subquery Scan on *SELECT* 9 (cost=0.43..366,649.48 rows=1 width=111) (actual time=0.027..0.027 rows=0 loops=1)

54. 0.000 0.026 ↓ 0.0 0 1

Nested Loop (cost=0.43..366,649.47 rows=1 width=111) (actual time=0.026..0.026 rows=0 loops=1)

55. 0.000 0.026 ↓ 0.0 0 1

Nested Loop (cost=0.00..366,643.22 rows=1 width=92) (actual time=0.026..0.026 rows=0 loops=1)

  • Join Filter: (popal_1.prescription_id = ppal_7.patient_presc_id)
56. 0.026 0.026 ↓ 0.0 0 1

Seq Scan on patient_operation_prescriptions_audit_log popal_1 (cost=0.00..1.73 rows=1 width=88) (actual time=0.026..0.026 rows=0 loops=1)

  • Filter: (((operation)::text = 'ChangeLog'::text) AND ((field_name)::text = 'prescription_id'::text))
  • Rows Removed by Filter: 49
57. 0.000 0.000 ↓ 0.0 0

Seq Scan on patient_prescription_audit_log ppal_7 (cost=0.00..366,495.76 rows=11,658 width=8) (never executed)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
58. 0.000 0.000 ↓ 0.0 0

Index Scan using doctor_consultation_pkey on doctor_consultation dc_7 (cost=0.43..6.24 rows=1 width=23) (never executed)

  • Index Cond: (consultation_id = ppal_7.consultation_id)
  • Filter: (((patient_id)::text = 'LCRCOP000804'::text) AND ((mr_no)::text = 'LCRC00000207'::text))
59. 0.001 2,650.339 ↓ 0.0 0 1

Subquery Scan on *SELECT* 10 (cost=0.43..366,689.03 rows=1 width=83) (actual time=2,650.339..2,650.339 rows=0 loops=1)

60. 0.000 2,650.338 ↓ 0.0 0 1

Nested Loop (cost=0.43..366,689.02 rows=1 width=83) (actual time=2,650.338..2,650.338 rows=0 loops=1)

  • Join Filter: (popal_2.prescription_id = pop.prescription_id)
61. 0.114 2,650.338 ↓ 0.0 0 1

Nested Loop (cost=0.43..366,672.48 rows=1 width=86) (actual time=2,650.338..2,650.338 rows=0 loops=1)

  • Join Filter: (ppal_8.patient_presc_id = popal_2.prescription_id)
  • Rows Removed by Join Filter: 810
62. 0.020 2,648.595 ↓ 9.0 9 1

Nested Loop (cost=0.43..366,649.93 rows=1 width=27) (actual time=107.827..2,648.595 rows=9 loops=1)

  • Join Filter: (ppal_8.consultation_id = dc_8.consultation_id)
63. 0.025 0.025 ↑ 1.0 1 1

Index Scan using doctor_consultation_patient_id_idx on doctor_consultation dc_8 (cost=0.43..8.45 rows=1 width=23) (actual time=0.022..0.025 rows=1 loops=1)

  • Index Cond: ((patient_id)::text = 'LCRCOP000804'::text)
  • Filter: ((mr_no)::text = 'LCRC00000207'::text)
64. 2,648.550 2,648.550 ↑ 1,295.3 9 1

Seq Scan on patient_prescription_audit_log ppal_8 (cost=0.00..366,495.76 rows=11,658 width=8) (actual time=107.788..2,648.550 rows=9 loops=1)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
  • Rows Removed by Filter: 10993508
65. 1.629 1.629 ↑ 1.0 90 9

Seq Scan on patient_other_prescriptions_audit_log popal_2 (cost=0.00..21.42 rows=90 width=59) (actual time=0.004..0.181 rows=90 loops=9)

  • Filter: (((operation)::text = 'INSERT'::text) AND ((field_name)::text = 'prescription_id'::text))
  • Rows Removed by Filter: 605
66. 0.000 0.000 ↓ 0.0 0

Seq Scan on patient_other_prescriptions pop (cost=0.00..11.24 rows=424 width=5) (never executed)

67. 0.001 0.147 ↓ 0.0 0 1

Subquery Scan on *SELECT* 11 (cost=0.43..366,685.71 rows=1 width=83) (actual time=0.147..0.147 rows=0 loops=1)

68. 0.000 0.146 ↓ 0.0 0 1

Nested Loop (cost=0.43..366,685.70 rows=1 width=83) (actual time=0.146..0.146 rows=0 loops=1)

  • Join Filter: (popal_3.prescription_id = pop_1.prescription_id)
69. 0.001 0.146 ↓ 0.0 0 1

Nested Loop (cost=0.43..366,669.16 rows=1 width=86) (actual time=0.146..0.146 rows=0 loops=1)

70. 0.000 0.145 ↓ 0.0 0 1

Nested Loop (cost=0.00..366,662.91 rows=1 width=67) (actual time=0.145..0.145 rows=0 loops=1)

  • Join Filter: (popal_3.prescription_id = ppal_9.patient_presc_id)
71. 0.145 0.145 ↓ 0.0 0 1

Seq Scan on patient_other_prescriptions_audit_log popal_3 (cost=0.00..21.42 rows=1 width=59) (actual time=0.145..0.145 rows=0 loops=1)

  • Filter: (((operation)::text = 'ChangeLog'::text) AND ((field_name)::text = 'prescription_id'::text))
  • Rows Removed by Filter: 695
72. 0.000 0.000 ↓ 0.0 0

Seq Scan on patient_prescription_audit_log ppal_9 (cost=0.00..366,495.76 rows=11,658 width=8) (never executed)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
73. 0.000 0.000 ↓ 0.0 0

Index Scan using doctor_consultation_pkey on doctor_consultation dc_9 (cost=0.43..6.24 rows=1 width=23) (never executed)

  • Index Cond: (consultation_id = ppal_9.consultation_id)
  • Filter: (((patient_id)::text = 'LCRCOP000804'::text) AND ((mr_no)::text = 'LCRC00000207'::text))
74. 0.000 0.000 ↓ 0.0 0

Seq Scan on patient_other_prescriptions pop_1 (cost=0.00..11.24 rows=424 width=5) (never executed)

75. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 12 (cost=0.43..366,660.60 rows=1 width=203) (actual time=0.001..0.001 rows=0 loops=1)

76. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.43..366,660.59 rows=1 width=203) (actual time=0.001..0.001 rows=0 loops=1)

77. 0.001 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..366,654.33 rows=1 width=184) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: (pompal.prescription_id = ppal_10.patient_presc_id)
78. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on patient_other_medicine_prescriptions_audit_log pompal (cost=0.00..12.85 rows=1 width=180) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (((operation)::text = 'INSERT'::text) AND ((field_name)::text = 'prescription_id'::text))
79. 0.000 0.000 ↓ 0.0 0

Seq Scan on patient_prescription_audit_log ppal_10 (cost=0.00..366,495.76 rows=11,658 width=8) (never executed)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
80. 0.000 0.000 ↓ 0.0 0

Index Scan using doctor_consultation_pkey on doctor_consultation dc_10 (cost=0.43..6.24 rows=1 width=23) (never executed)

  • Index Cond: (consultation_id = ppal_10.consultation_id)
  • Filter: (((patient_id)::text = 'LCRCOP000804'::text) AND ((mr_no)::text = 'LCRC00000207'::text))
81. 0.001 0.002 ↓ 0.0 0 1

Subquery Scan on *SELECT* 13 (cost=0.43..366,660.60 rows=1 width=203) (actual time=0.002..0.002 rows=0 loops=1)

82. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.43..366,660.59 rows=1 width=203) (actual time=0.001..0.001 rows=0 loops=1)

83. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.00..366,654.33 rows=1 width=184) (actual time=0.001..0.001 rows=0 loops=1)

  • Join Filter: (pompal_1.prescription_id = ppal_11.patient_presc_id)
84. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on patient_other_medicine_prescriptions_audit_log pompal_1 (cost=0.00..12.85 rows=1 width=180) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (((operation)::text = 'ChangeLog'::text) AND ((field_name)::text = 'prescription_id'::text))
85. 0.000 0.000 ↓ 0.0 0

Seq Scan on patient_prescription_audit_log ppal_11 (cost=0.00..366,495.76 rows=11,658 width=8) (never executed)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
86. 0.000 0.000 ↓ 0.0 0

Index Scan using doctor_consultation_pkey on doctor_consultation dc_11 (cost=0.43..6.24 rows=1 width=23) (never executed)

  • Index Cond: (consultation_id = ppal_11.consultation_id)
  • Filter: (((patient_id)::text = 'LCRCOP000804'::text) AND ((mr_no)::text = 'LCRC00000207'::text))
87. 0.008 36,834.244 ↓ 5.0 5 1

Subquery Scan on *SELECT* 14 (cost=0.43..742,184.39 rows=1 width=79) (actual time=1,827.197..36,834.244 rows=5 loops=1)

88. 1,035.462 36,834.236 ↓ 5.0 5 1

Nested Loop (cost=0.43..742,184.38 rows=1 width=79) (actual time=1,827.195..36,834.236 rows=5 loops=1)

  • Join Filter: (ppal_12.patient_presc_id = pmpal.op_medicine_pres_id)
  • Rows Removed by Join Filter: 7701970
89. 0.038 2,660.396 ↓ 9.0 9 1

Nested Loop (cost=0.43..366,649.93 rows=1 width=27) (actual time=104.968..2,660.396 rows=9 loops=1)

  • Join Filter: (ppal_12.consultation_id = dc_12.consultation_id)
90. 0.028 0.028 ↑ 1.0 1 1

Index Scan using doctor_consultation_patient_id_idx on doctor_consultation dc_12 (cost=0.43..8.45 rows=1 width=23) (actual time=0.025..0.028 rows=1 loops=1)

  • Index Cond: ((patient_id)::text = 'LCRCOP000804'::text)
  • Filter: ((mr_no)::text = 'LCRC00000207'::text)
91. 2,660.330 2,660.330 ↑ 1,295.3 9 1

Seq Scan on patient_prescription_audit_log ppal_12 (cost=0.00..366,495.76 rows=11,658 width=8) (actual time=104.923..2,660.330 rows=9 loops=1)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
  • Rows Removed by Filter: 10993508
92. 33,138.378 33,138.378 ↓ 1.1 855,775 9

Seq Scan on patient_medicine_prescriptions_audit_log pmpal (cost=0.00..365,492.27 rows=803,374 width=56) (actual time=0.008..3,682.042 rows=855,775 loops=9)

  • Filter: (((operation)::text = 'INSERT'::text) AND ((field_name)::text = 'op_medicine_pres_id'::text))
  • Rows Removed by Filter: 12658077
93. 0.000 2,797.527 ↓ 0.0 0 1

Subquery Scan on *SELECT* 15 (cost=0.43..732,140.02 rows=1 width=79) (actual time=2,797.527..2,797.527 rows=0 loops=1)

94. 0.002 2,797.527 ↓ 0.0 0 1

Nested Loop (cost=0.43..732,140.01 rows=1 width=79) (actual time=2,797.527..2,797.527 rows=0 loops=1)

95. 0.000 2,797.525 ↓ 0.0 0 1

Nested Loop (cost=0.00..732,133.76 rows=1 width=60) (actual time=2,797.525..2,797.525 rows=0 loops=1)

  • Join Filter: (pmpal_1.op_medicine_pres_id = ppal_13.patient_presc_id)
96. 2,797.525 2,797.525 ↓ 0.0 0 1

Seq Scan on patient_medicine_prescriptions_audit_log pmpal_1 (cost=0.00..365,492.27 rows=1 width=56) (actual time=2,797.525..2,797.525 rows=0 loops=1)

  • Filter: (((operation)::text = 'ChangeLog'::text) AND ((field_name)::text = 'op_medicine_pres_id'::text))
  • Rows Removed by Filter: 13513852
97. 0.000 0.000 ↓ 0.0 0

Seq Scan on patient_prescription_audit_log ppal_13 (cost=0.00..366,495.76 rows=11,658 width=8) (never executed)

  • Filter: (((field_name)::text = 'consultation_id'::text) AND ((consultation_id)::text = '1207048'::text))
98. 0.000 0.000 ↓ 0.0 0

Index Scan using doctor_consultation_pkey on doctor_consultation dc_13 (cost=0.43..6.24 rows=1 width=23) (never executed)

  • Index Cond: (consultation_id = ppal_13.consultation_id)
  • Filter: (((patient_id)::text = 'LCRCOP000804'::text) AND ((mr_no)::text = 'LCRC00000207'::text))
Total runtime : 59,776.528 ms