explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oaLt

Settings
# exclusive inclusive rows x rows loops node
1. 0.018 3,257.369 ↓ 20.0 20 1

Limit (cost=1,379.03..167,331.02 rows=1 width=1,408) (actual time=331.801..3,257.369 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, ((SubPlan 1)), appointmen19_.name, appointmen0_.state_id, ((SubPlan 2)), individual1_.id, ((((((COALESCE(individual1_.surname, ''::character varying))::text || ' '::text) || (COALESCE(individual1_.name, ''::character varying))::text) || ' '::text) || (COALESCE(individual1_.patr_name, ''::character varying))::text)), appointmen0_.notif_contact, individual1_.birth_dt, ((SubPlan 3)), resourcegr2_.id, resourcegr2_.name, appointmen0_.service_id, service20_.name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, organizati3_.id, (COALESCE(organizati3_.short_name, organizati3_.full_name)), appointmen0_.source_id, appointmen21_.name, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen10_.code, appointmen10_.name, (CASE WHEN ((referral7_.id IS NOT NULL) AND (referral7_.date_cancel IS NULL)) THEN true ELSE false END), appointmen0_.registrator_id, appointmen0_.reject_comment, ((SubPlan 5)), referralty8_.name, referral7_.order_number, referral7_.referral_date, (COALESCE(organizati9_.short_name, organizati9_.full_name)), diagnosis11_.code, diagnosis11_.name, medicalemp12_.id, speciality15_.name, individual17_.surname, individual17_.name, individual17_.patr_name, appointmen0_.is_cito, (COALESCE(appointmen0_.is_send_message, false)), appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, (CASE WHEN ((SubPlan 6) > 0) THEN true ELSE false END), appointmen18_.name
  • Buffers: shared hit=26,809 read=362 dirtied=3
  • I/O Timings: read=2,844.679
2. 1.199 3,257.351 ↓ 20.0 20 1

Nested Loop (cost=1,379.03..167,331.02 rows=1 width=1,408) (actual time=331.800..3,257.351 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, (SubPlan 1), appointmen19_.name, appointmen0_.state_id, (SubPlan 2), individual1_.id, (((((COALESCE(individual1_.surname, ''::character varying))::text || ' '::text) || (COALESCE(individual1_.name, ''::character varying))::text) || ' '::text) || (COALESCE(individual1_.patr_name, ''::character varying))::text), appointmen0_.notif_contact, individual1_.birth_dt, (SubPlan 3), resourcegr2_.id, resourcegr2_.name, appointmen0_.service_id, service20_.name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, organizati3_.id, COALESCE(organizati3_.short_name, organizati3_.full_name), appointmen0_.source_id, appointmen21_.name, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen10_.code, appointmen10_.name, CASE WHEN ((referral7_.id IS NOT NULL) AND (referral7_.date_cancel IS NULL)) THEN true ELSE false END, appointmen0_.registrator_id, appointmen0_.reject_comment, (SubPlan 5), referralty8_.name, referral7_.order_number, referral7_.referral_date, COALESCE(organizati9_.short_name, organizati9_.full_name), diagnosis11_.code, diagnosis11_.name, medicalemp12_.id, speciality15_.name, individual17_.surname, individual17_.name, individual17_.patr_name, appointmen0_.is_cito, COALESCE(appointmen0_.is_send_message, false), appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, CASE WHEN ((SubPlan 6) > 0) THEN true ELSE false END, appointmen18_.name
  • Join Filter: (appointmen0_.source_id = appointmen21_.id)
  • Rows Removed by Join Filter: 172
  • Buffers: shared hit=26,809 read=362 dirtied=3
  • I/O Timings: read=2,844.679
3. 0.121 1,502.052 ↓ 20.0 20 1

Nested Loop (cost=1,379.03..167,257.56 rows=1 width=1,387) (actual time=252.684..1,502.052 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, referral7_.id, referral7_.date_cancel, referral7_.order_number, referral7_.referral_date, referralty8_.name, organizati9_.short_name, organizati9_.full_name, diagnosis11_.code, diagnosis11_.name, medicalemp12_.id, speciality15_.name, individual17_.surname, individual17_.name, individual17_.patr_name, appointmen10_.code, appointmen10_.name, appointmen18_.name, appointmen19_.name, service20_.name
  • Buffers: shared hit=26,455 read=161 dirtied=3
  • I/O Timings: read=1,098.016
4. 0.697 1,472.571 ↓ 20.0 20 1

Nested Loop (cost=1,378.61..167,251.53 rows=1 width=1,274) (actual time=252.631..1,472.571 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, referral7_.id, referral7_.date_cancel, referral7_.order_number, referral7_.referral_date, referralty8_.name, organizati9_.short_name, organizati9_.full_name, diagnosis11_.code, diagnosis11_.name, medicalemp12_.id, speciality15_.name, individual17_.surname, individual17_.name, individual17_.patr_name, appointmen10_.code, appointmen10_.name, appointmen18_.name, appointmen19_.name
  • Join Filter: ((SubPlan 7) = appointmen19_.id)
  • Rows Removed by Join Filter: 137
  • Buffers: shared hit=26,377 read=159 dirtied=3
  • I/O Timings: read=1,069.212
5. 0.209 1,309.553 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,378.61..167,181.60 rows=1 width=1,245) (actual time=245.680..1,309.553 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, referral7_.id, referral7_.date_cancel, referral7_.order_number, referral7_.referral_date, referralty8_.name, organizati9_.short_name, organizati9_.full_name, diagnosis11_.code, diagnosis11_.name, medicalemp12_.id, speciality15_.name, individual17_.surname, individual17_.name, individual17_.patr_name, appointmen10_.code, appointmen10_.name, appointmen18_.name
  • Join Filter: (appointmen0_.cancel_base_id = appointmen18_.id)
  • Rows Removed by Join Filter: 60
  • Buffers: shared hit=25,595 read=136 dirtied=3
  • I/O Timings: read=909.871
6. 0.198 1,301.944 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,378.61..167,163.95 rows=1 width=1,217) (actual time=238.289..1,301.944 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, referral7_.id, referral7_.date_cancel, referral7_.order_number, referral7_.referral_date, referralty8_.name, organizati9_.short_name, organizati9_.full_name, diagnosis11_.code, diagnosis11_.name, medicalemp12_.id, speciality15_.name, individual17_.surname, individual17_.name, individual17_.patr_name, appointmen10_.code, appointmen10_.name
  • Join Filter: (appointmen0_.queue_state_id = appointmen10_.id)
  • Rows Removed by Join Filter: 80
  • Buffers: shared hit=25,576 read=135 dirtied=3
  • I/O Timings: read=902.538
7. 0.115 1,301.686 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,378.61..167,162.86 rows=1 width=1,199) (actual time=238.272..1,301.686 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, referral7_.id, referral7_.date_cancel, referral7_.order_number, referral7_.referral_date, referralty8_.name, organizati9_.short_name, organizati9_.full_name, diagnosis11_.code, diagnosis11_.name, medicalemp12_.id, speciality15_.name, individual17_.surname, individual17_.name, individual17_.patr_name
  • Buffers: shared hit=25,556 read=135 dirtied=3
  • I/O Timings: read=902.538
8. 1.203 1,301.551 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,378.18..167,156.26 rows=1 width=1,152) (actual time=238.266..1,301.551 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, referral7_.id, referral7_.date_cancel, referral7_.order_number, referral7_.referral_date, referralty8_.name, organizati9_.short_name, organizati9_.full_name, diagnosis11_.code, diagnosis11_.name, medicalemp12_.id, speciality15_.name, employee16_.individual_id
  • Join Filter: (position14_.speciality_id = speciality15_.id)
  • Rows Removed by Join Filter: 3,720
  • Buffers: shared hit=25,556 read=135 dirtied=3
  • I/O Timings: read=902.538
9. 0.174 1,299.348 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,378.18..167,141.08 rows=1 width=1,118) (actual time=238.085..1,299.348 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, referral7_.id, referral7_.date_cancel, referral7_.order_number, referral7_.referral_date, referralty8_.name, organizati9_.short_name, organizati9_.full_name, diagnosis11_.code, diagnosis11_.name, medicalemp12_.id, position14_.speciality_id, employee16_.individual_id
  • Buffers: shared hit=25,336 read=135 dirtied=3
  • I/O Timings: read=902.538
10. 56.625 1,298.974 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,377.02..167,120.60 rows=1 width=1,110) (actual time=238.057..1,298.974 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, referral7_.id, referral7_.date_cancel, referral7_.order_number, referral7_.referral_date, referral7_.recv_doctor_id, referralty8_.name, organizati9_.short_name, organizati9_.full_name, diagnosis11_.code, diagnosis11_.name
  • Join Filter: (referral7_.diagnosis_id = diagnosis11_.id)
  • Rows Removed by Join Filter: 298,680
  • Buffers: shared hit=25,336 read=135 dirtied=3
  • I/O Timings: read=902.538
11. 53.885 1,164.789 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,377.02..166,378.07 rows=1 width=991) (actual time=228.788..1,164.789 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, referral7_.id, referral7_.date_cancel, referral7_.order_number, referral7_.referral_date, referral7_.diagnosis_id, referral7_.recv_doctor_id, referralty8_.name, organizati9_.short_name, organizati9_.full_name
  • Join Filter: (referral7_.ref_organization_id = organizati9_.id)
  • Rows Removed by Join Filter: 340,960
  • Buffers: shared hit=17,256 read=135 dirtied=3
  • I/O Timings: read=902.538
12. 0.355 980.904 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,377.02..165,624.64 rows=1 width=888) (actual time=216.665..980.904 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, referral7_.id, referral7_.date_cancel, referral7_.order_number, referral7_.referral_date, referral7_.ref_organization_id, referral7_.diagnosis_id, referral7_.recv_doctor_id, referralty8_.name
  • Join Filter: (referral7_.referral_type_id = referralty8_.id)
  • Rows Removed by Join Filter: 620
  • Buffers: shared hit=9,856 read=135 dirtied=3
  • I/O Timings: read=902.538
13. 0.131 980.249 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,377.02..165,621.95 rows=1 width=828) (actual time=216.610..980.249 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name, referral7_.id, referral7_.date_cancel, referral7_.order_number, referral7_.referral_date, referral7_.referral_type_id, referral7_.ref_organization_id, referral7_.diagnosis_id, referral7_.recv_doctor_id
  • Buffers: shared hit=9,816 read=135 dirtied=3
  • I/O Timings: read=902.538
14. 0.226 980.098 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,376.59..165,615.84 rows=1 width=797) (actual time=216.601..980.098 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.referral_id, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name, careregime6_.id, careregime6_.name
  • Join Filter: (appointmen0_.care_regimen_id = careregime6_.id)
  • Rows Removed by Join Filter: 140
  • Buffers: shared hit=9,816 read=135 dirtied=3
  • I/O Timings: read=902.538
15. 0.259 979.772 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,376.59..165,614.69 rows=1 width=756) (actual time=216.559..979.772 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.care_regimen_id, appointmen0_.referral_id, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name, fundingsou5_.name
  • Join Filter: (appointmen0_.funding_id = fundingsou5_.id)
  • Rows Removed by Join Filter: 160
  • Buffers: shared hit=9,796 read=135 dirtied=3
  • I/O Timings: read=902.538
16. 0.440 979.413 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,376.59..165,613.51 rows=1 width=731) (actual time=216.533..979.413 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.funding_id, appointmen0_.care_regimen_id, appointmen0_.referral_id, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name, caseinitgo4_.id, caseinitgo4_.name
  • Join Filter: (appointmen0_.init_goal_id = caseinitgo4_.id)
  • Rows Removed by Join Filter: 680
  • Buffers: shared hit=9,776 read=135 dirtied=3
  • I/O Timings: read=902.538
17. 0.094 978.613 ↓ 20.0 20 1

Nested Loop (cost=1,376.59..165,610.74 rows=1 width=656) (actual time=216.434..978.613 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.init_goal_id, appointmen0_.funding_id, appointmen0_.care_regimen_id, appointmen0_.referral_id, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name
  • Buffers: shared hit=9,736 read=135 dirtied=3
  • I/O Timings: read=902.538
18. 0.119 978.059 ↓ 20.0 20 1

Nested Loop (cost=1,376.16..165,602.28 rows=1 width=656) (actual time=216.324..978.059 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.init_goal_id, appointmen0_.funding_id, appointmen0_.care_regimen_id, appointmen0_.referral_id, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id, organizati3_.id, organizati3_.short_name, organizati3_.full_name
  • Buffers: shared hit=9,675 read=135 dirtied=3
  • I/O Timings: read=902.538
19. 0.196 977.440 ↓ 20.0 20 1

Nested Loop Left Join (cost=1,375.88..165,593.97 rows=1 width=545) (actual time=216.238..977.440 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.init_goal_id, appointmen0_.funding_id, appointmen0_.care_regimen_id, appointmen0_.referral_id, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, individual1_.id, individual1_.surname, individual1_.name, individual1_.patr_name, individual1_.birth_dt, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id
  • Buffers: shared hit=9,615 read=135 dirtied=3
  • I/O Timings: read=902.538
20. 0.271 859.804 ↓ 20.0 20 1

Nested Loop (cost=1,375.45..165,587.76 rows=1 width=486) (actual time=207.045..859.804 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.init_goal_id, appointmen0_.funding_id, appointmen0_.care_regimen_id, appointmen0_.referral_id, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id
  • Buffers: shared hit=9,560 read=110 dirtied=3
  • I/O Timings: read=786.348
21. 0.522 732.873 ↓ 20.0 20 1

Hash Join (cost=1,375.01..165,584.15 rows=1 width=486) (actual time=197.898..732.873 rows=20 loops=1)

  • Output: appointmen0_.id, appointmen0_.ticket_number, appointmen0_.bdatetime, appointmen0_.edatetime, appointmen0_.state_id, appointmen0_.customer_id, appointmen0_.notif_contact, appointmen0_.service_id, appointmen0_.source_id, appointmen0_.comment, appointmen0_.srv_rendered_id, appointmen0_.is_urgent, appointmen0_.registration_dt, appointmen0_.price, appointmen0_.registrator_id, appointmen0_.reject_comment, appointmen0_.is_cito, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.aud_source, appointmen0_.auto_return_state, appointmen0_.init_goal_id, appointmen0_.funding_id, appointmen0_.care_regimen_id, appointmen0_.referral_id, appointmen0_.queue_state_id, appointmen0_.cancel_base_id, resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id
  • Hash Cond: (appointmen0_.executor_id = resourcegr2_.id)
  • Buffers: shared hit=9,514 read=86 dirtied=3
  • I/O Timings: read=660.593
22. 662.564 662.564 ↑ 1,127.8 84 1

Index Scan using md_appointment_bdatetime_idx on public.md_appointment appointmen0_ (cost=0.56..163,854.46 rows=94,731 width=410) (actual time=27.760..662.564 rows=84 loops=1)

  • Output: appointmen0_.id, appointmen0_.srv_rendered_id, appointmen0_.executor_id, appointmen0_.bdatetime, appointmen0_.customer_id, appointmen0_.funding_id, appointmen0_.state_id, appointmen0_.service_id, appointmen0_.cancel_reason_id, appointmen0_.care_regimen_id, appointmen0_.care_level_id, appointmen0_.referral_id, appointmen0_.source_id, appointmen0_.registrator_id, appointmen0_.registration_dt, appointmen0_.edatetime, appointmen0_.is_urgent, appointmen0_.notif_contact, appointmen0_.price_list_id, appointmen0_.message, appointmen0_.queue_state_id, appointmen0_.queue_change_dt, appointmen0_.ticket_number, appointmen0_.price, appointmen0_.init_goal_id, appointmen0_.organization_id, appointmen0_.is_house_call, appointmen0_.comment, appointmen0_.aud_who, appointmen0_.aud_when, appointmen0_.aud_source, appointmen0_.aud_who_create, appointmen0_.aud_when_create, appointmen0_.aud_source_create, appointmen0_.reject_comment, appointmen0_.reject_reason_id, appointmen0_.way_id, appointmen0_.is_cito, appointmen0_.event_id, appointmen0_.is_send_message, appointmen0_.comment_send_message, appointmen0_.cancel_dt, appointmen0_.answer_portal_code, appointmen0_.registrator_org_id, appointmen0_.original_appointment_id, appointmen0_.auto_return_state, appointmen0_.cancel_base_id
  • Index Cond: ((appointmen0_.bdatetime >= '2020-01-14 00:00:00'::timestamp without time zone) AND (appointmen0_.bdatetime <= '2020-01-20 23:59:59.999'::timestamp without time zone))
  • Filter: (NOT appointmen0_.is_house_call)
  • Buffers: shared hit=2 read=86
  • I/O Timings: read=660.593
23. 0.626 69.787 ↑ 1.2 729 1

Hash (cost=1,363.23..1,363.23 rows=897 width=80) (actual time=69.787..69.787 rows=729 loops=1)

  • Output: resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 94kB
  • Buffers: shared hit=9,509 dirtied=3
24. 69.161 69.161 ↑ 1.2 729 1

Index Scan using sr_res_group_id_is_system_ix on public.sr_res_group resourcegr2_ (cost=0.28..1,363.23 rows=897 width=80) (actual time=0.372..69.161 rows=729 loops=1)

  • Output: resourcegr2_.id, resourcegr2_.name, resourcegr2_.org_id
  • Filter: (resourcegr2_.org_id = 36,988)
  • Rows Removed by Filter: 8,952
  • Buffers: shared hit=9,509 dirtied=3
25. 126.660 126.660 ↑ 1.0 1 20

Index Only Scan using sr_ticket_pk on public.sr_ticket appointmen0_1_ (cost=0.44..3.60 rows=1 width=4) (actual time=6.332..6.333 rows=1 loops=20)

  • Output: appointmen0_1_.id
  • Index Cond: (appointmen0_1_.id = appointmen0_.id)
  • Heap Fetches: 0
  • Buffers: shared hit=46 read=24
  • I/O Timings: read=125.755
26. 117.440 117.440 ↑ 1.0 1 20

Index Scan using pim_individual_pk on public.pim_individual individual1_ (cost=0.43..6.20 rows=1 width=59) (actual time=5.870..5.872 rows=1 loops=20)

  • Output: individual1_.id, individual1_.birth_dt, individual1_.death_dt, individual1_.has_citizenship, individual1_.name, individual1_.patr_name, individual1_.surname, individual1_.gender_id, individual1_.nationality_id, individual1_.list_identity_doc, individual1_.list_oms_doc, individual1_.list_job_org, individual1_.list_reg_name, individual1_.list_snils, individual1_.list_uid, individual1_.aud_who, individual1_.aud_when, individual1_.aud_source, individual1_.aud_who_create, individual1_.aud_when_create, individual1_.aud_source_create, individual1_.birth_place, individual1_.age_year, individual1_.age_month, individual1_.age_day, individual1_.list_main_contact, individual1_.is_only_birth_year
  • Index Cond: (appointmen0_.customer_id = individual1_.id)
  • Buffers: shared hit=55 read=25
  • I/O Timings: read=116.190
27. 0.500 0.500 ↑ 1.0 1 20

Index Scan using pim_organization_pk on public.pim_organization organizati3_ (cost=0.29..8.30 rows=1 width=111) (actual time=0.022..0.025 rows=1 loops=20)

  • Output: organizati3_.id, organizati3_.short_name, organizati3_.full_name
  • Index Cond: (organizati3_.id = 36,988)
  • Buffers: shared hit=60
28. 0.460 0.460 ↑ 1.0 1 20

Index Only Scan using pim_party_pk on public.pim_party organizati3_1_ (cost=0.43..8.45 rows=1 width=4) (actual time=0.020..0.023 rows=1 loops=20)

  • Output: organizati3_1_.id
  • Index Cond: (organizati3_1_.id = 36,988)
  • Heap Fetches: 0
  • Buffers: shared hit=61
29. 0.360 0.360 ↑ 1.0 34 20

Seq Scan on public.mc_case_init_goal caseinitgo4_ (cost=0.00..2.34 rows=34 width=79) (actual time=0.008..0.018 rows=34 loops=20)

  • Output: caseinitgo4_.id, caseinitgo4_.code, caseinitgo4_.name, caseinitgo4_.visit_type_id, caseinitgo4_.e_code, caseinitgo4_.aud_who, caseinitgo4_.aud_when, caseinitgo4_.aud_source, caseinitgo4_.aud_who_create, caseinitgo4_.aud_when_create, caseinitgo4_.aud_source_create, caseinitgo4_.from_dt, caseinitgo4_.to_dt, caseinitgo4_.billing_code
  • Buffers: shared hit=40
30. 0.100 0.100 ↑ 1.0 8 20

Seq Scan on public.fin_funding_source_type fundingsou5_ (cost=0.00..1.08 rows=8 width=33) (actual time=0.004..0.005 rows=8 loops=20)

  • Output: fundingsou5_.id, fundingsou5_.bdate, fundingsou5_.code, fundingsou5_.edate, fundingsou5_.name, fundingsou5_.ordern, fundingsou5_.parent_id, fundingsou5_.has_exception, fundingsou5_.e_code, fundingsou5_.is_contract_required, fundingsou5_.is_citizen, fundingsou5_.is_payer_smo, fundingsou5_.is_payer_foms, fundingsou5_.is_default, fundingsou5_.is_privileged, fundingsou5_.aud_who, fundingsou5_.aud_when, fundingsou5_.aud_source, fundingsou5_.aud_who_create, fundingsou5_.aud_when_create, fundingsou5_.aud_source_create, fundingsou5_.from_dt, fundingsou5_.to_dt, fundingsou5_.is_vmp, fundingsou5_.billing_code
  • Buffers: shared hit=20
31. 0.100 0.100 ↑ 1.0 7 20

Seq Scan on public.mc_care_regimen careregime6_ (cost=0.00..1.07 rows=7 width=45) (actual time=0.004..0.005 rows=7 loops=20)

  • Output: careregime6_.id, careregime6_.bdate, careregime6_.is_bed_required, careregime6_.case_mode_id, careregime6_.med_cert_name, careregime6_.code, careregime6_.edate, careregime6_.name, careregime6_.e_code, careregime6_.aud_who, careregime6_.aud_when, careregime6_.aud_source, careregime6_.aud_who_create, careregime6_.aud_when_create, careregime6_.aud_source_create, careregime6_.from_dt, careregime6_.to_dt, careregime6_.is_not_admission, careregime6_.billing_code
  • Buffers: shared hit=20
32. 0.020 0.020 ↓ 0.0 0 20

Index Scan using md_referral_pk on public.md_referral referral7_ (cost=0.43..6.09 rows=1 width=35) (actual time=0.001..0.001 rows=0 loops=20)

  • Output: referral7_.id, referral7_.diagnosis_comment, referral7_.is_urgent, referral7_.order_number, referral7_.referral_comment, referral7_.referral_date, referral7_.diagnosis_id, referral7_.ref_doctor_id, referral7_.funding_id, referral7_.ref_organization_id, referral7_.patient_id, referral7_.prescription_id, referral7_.recv_organization_id, referral7_.recv_doctor_id, referral7_.service_pat_id, referral7_.referral_type_id, referral7_.department_id, referral7_.note, referral7_.step_id, referral7_.service_id, referral7_.goal_id, referral7_.recv_res_group_id, referral7_.date_cancel, referral7_.cancel_reason_id, referral7_.cancel_source_id, referral7_.ref_department_id, referral7_.comment, referral7_.status_id, referral7_.cancel_reason_detail, referral7_.cancel_source_org, referral7_.cancel_source_dep, referral7_.aud_who, referral7_.aud_when, referral7_.aud_source, referral7_.aud_who_create, referral7_.aud_when_create, referral7_.aud_source_create, referral7_.clinical_form_id, referral7_.localization_id, referral7_.complication_id, referral7_.recv_regimen_id, referral7_.ref_organization_role_id, referral7_.case_id, referral7_.receiving_speciality_id, referral7_.is_operation_required, referral7_.ref_organization_code, referral7_.ref_doctor_code, referral7_.ref_status_id, referral7_.send_date, referral7_.vmp_profile_id, referral7_.vmp_kind_id, referral7_.profile_id, referral7_.bed_profile_id, referral7_.proposed_date, referral7_.disease_type_id, referral7_.is_agreement_received, referral7_.downloaded_for_pfr, referral7_.recv_organization_code, referral7_.recv_doctor_code
  • Index Cond: (appointmen0_.referral_id = referral7_.id)
33. 0.300 0.300 ↑ 1.0 31 20

Seq Scan on public.md_referral_type referralty8_ (cost=0.00..2.31 rows=31 width=68) (actual time=0.006..0.015 rows=31 loops=20)

  • Output: referralty8_.id, referralty8_.code, referralty8_.name, referralty8_.scope_id, referralty8_.e_code, referralty8_.hsp_rsv_mark, referralty8_.aud_who, referralty8_.aud_when, referralty8_.aud_source, referralty8_.aud_who_create, referralty8_.aud_when_create, referralty8_.aud_source_create, referralty8_.from_dt, referralty8_.to_dt, referralty8_.app_code, referralty8_.is_laboratory, referralty8_.is_vk, referralty8_.billing_code
  • Buffers: shared hit=40
34. 130.000 130.000 ↓ 1.0 17,048 20

Seq Scan on public.pim_organization organizati9_ (cost=0.00..540.41 rows=17,041 width=111) (actual time=0.006..6.500 rows=17,048 loops=20)

  • Output: organizati9_.short_name, organizati9_.full_name, organizati9_.id
  • Buffers: shared hit=7,400
35. 77.560 77.560 ↑ 1.0 14,934 20

Seq Scan on public.md_diagnosis diagnosis11_ (cost=0.00..554.46 rows=15,046 width=127) (actual time=0.006..3.878 rows=14,934 loops=20)

  • Output: diagnosis11_.id, diagnosis11_.code, diagnosis11_.name, diagnosis11_.parent_id, diagnosis11_.is_injury, diagnosis11_.level, diagnosis11_.is_leaf, diagnosis11_.e_code, diagnosis11_.oms, diagnosis11_.stomat, diagnosis11_.aud_who, diagnosis11_.aud_when, diagnosis11_.aud_source, diagnosis11_.aud_who_create, diagnosis11_.aud_when_create, diagnosis11_.aud_source_create, diagnosis11_.from_dt, diagnosis11_.to_dt, diagnosis11_.d_accounting
  • Buffers: shared hit=8,080
36. 0.040 0.200 ↓ 0.0 0 20

Nested Loop Left Join (cost=1.16..20.47 rows=1 width=12) (actual time=0.010..0.010 rows=0 loops=20)

  • Output: medicalemp12_.id, position14_.speciality_id, employee16_.individual_id
37. 0.040 0.160 ↓ 0.0 0 20

Nested Loop Left Join (cost=0.87..14.66 rows=1 width=12) (actual time=0.008..0.008 rows=0 loops=20)

  • Output: medicalemp12_.id, employeeto13_.employee_id, position14_.speciality_id
38. 0.080 0.120 ↓ 0.0 0 20

Nested Loop Left Join (cost=0.58..8.86 rows=1 width=12) (actual time=0.006..0.006 rows=0 loops=20)

  • Output: medicalemp12_.id, employeeto13_.position_id, employeeto13_.employee_id
39. 0.040 0.040 ↓ 0.0 0 20

Index Only Scan using md_employee_position_pk on public.md_employee_position medicalemp12_ (cost=0.29..3.06 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=20)

  • Output: medicalemp12_.id
  • Index Cond: (medicalemp12_.id = referral7_.recv_doctor_id)
  • Heap Fetches: 0
40. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_employee_position_id_position_id_idx on public.pim_employee_position employeeto13_ (cost=0.29..5.79 rows=1 width=12) (never executed)

  • Output: employeeto13_.id, employeeto13_.dismissal_order_code, employeeto13_.start_date, employeeto13_.hiring_order_code, employeeto13_.rate, employeeto13_.end_date, employeeto13_.dismissal_reason_id, employeeto13_.employee_id, employeeto13_.employment_type_id, employeeto13_.hiring_type_id, employeeto13_.position_id, employeeto13_.position_type_id, employeeto13_.unit_id, employeeto13_.code, employeeto13_.aud_who, employeeto13_.aud_when, employeeto13_.aud_source, employeeto13_.aud_who_create, employeeto13_.aud_when_create, employeeto13_.aud_source_create, employeeto13_.pref_prescription, employeeto13_.extra_payment, employeeto13_.target_training, employeeto13_.leaving_reason_id, employeeto13_.is_chairman
  • Index Cond: (medicalemp12_.id = employeeto13_.id)
41. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_position_pk on public.pim_position position14_ (cost=0.29..5.79 rows=1 width=8) (never executed)

  • Output: position14_.id, position14_.code, position14_.start_date, position14_.name, position14_.end_date, position14_.department_id, position14_.organization_id, position14_.role_id, position14_.speciality_id, position14_.rate, position14_.aud_who, position14_.aud_when, position14_.aud_source, position14_.aud_who_create, position14_.aud_when_create, position14_.aud_source_create, position14_.pref_prescription, position14_.payment_fond, position14_.staff_event1, position14_.staff_event2, position14_.note, position14_.fact_employment, position14_.external_rate, position14_.billing_code
  • Index Cond: (employeeto13_.position_id = position14_.id)
42. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_employee_pk on public.pim_employee employee16_ (cost=0.29..5.79 rows=1 width=8) (never executed)

  • Output: employee16_.id, employee16_.note, employee16_.number, employee16_.photo, employee16_.callup_subject_id, employee16_.individual_id, employee16_.organization_id, employee16_.is_dismissed, employee16_.employment_dt, employee16_.dismissal_dt, employee16_.aud_who, employee16_.aud_when, employee16_.aud_source, employee16_.aud_who_create, employee16_.aud_when_create, employee16_.aud_source_create, employee16_.accreditation_id, employee16_.inherit_employee_id, employee16_.inherit_register_card
  • Index Cond: (employeeto13_.employee_id = employee16_.id)
43. 1.000 1.000 ↑ 1.0 186 20

Seq Scan on public.pim_speciality speciality15_ (cost=0.00..12.86 rows=186 width=42) (actual time=0.004..0.050 rows=186 loops=20)

  • Output: speciality15_.id, speciality15_.code, speciality15_.code_regional, speciality15_.name, speciality15_.sphere_id, speciality15_.parent_id, speciality15_.education_type_id, speciality15_.e_code, speciality15_.aud_who, speciality15_.aud_when, speciality15_.aud_source, speciality15_.aud_who_create, speciality15_.aud_when_create, speciality15_.aud_source_create, speciality15_.from_dt, speciality15_.to_dt, speciality15_.billing_code
  • Buffers: shared hit=220
44. 0.020 0.020 ↓ 0.0 0 20

Index Scan using pim_individual_pk on public.pim_individual individual17_ (cost=0.43..6.59 rows=1 width=55) (actual time=0.001..0.001 rows=0 loops=20)

  • Output: individual17_.id, individual17_.birth_dt, individual17_.death_dt, individual17_.has_citizenship, individual17_.name, individual17_.patr_name, individual17_.surname, individual17_.gender_id, individual17_.nationality_id, individual17_.list_identity_doc, individual17_.list_oms_doc, individual17_.list_job_org, individual17_.list_reg_name, individual17_.list_snils, individual17_.list_uid, individual17_.aud_who, individual17_.aud_when, individual17_.aud_source, individual17_.aud_who_create, individual17_.aud_when_create, individual17_.aud_source_create, individual17_.birth_place, individual17_.age_year, individual17_.age_month, individual17_.age_day, individual17_.list_main_contact, individual17_.is_only_birth_year
  • Index Cond: (employee16_.individual_id = individual17_.id)
45. 0.060 0.060 ↑ 1.0 4 20

Seq Scan on public.md_appointment_queue_state appointmen10_ (cost=0.00..1.04 rows=4 width=26) (actual time=0.003..0.003 rows=4 loops=20)

  • Output: appointmen10_.id, appointmen10_.name, appointmen10_.code, appointmen10_.e_code, appointmen10_.aud_who, appointmen10_.aud_when, appointmen10_.aud_source, appointmen10_.aud_who_create, appointmen10_.aud_when_create, appointmen10_.aud_source_create, appointmen10_.from_dt, appointmen10_.to_dt
  • Buffers: shared hit=20
46. 7.400 7.400 ↑ 113.3 3 20

Seq Scan on public.md_appointment_cancel_base appointmen18_ (cost=0.00..13.40 rows=340 width=36) (actual time=0.370..0.370 rows=3 loops=20)

  • Output: appointmen18_.id, appointmen18_.code, appointmen18_.name, appointmen18_.aud_who, appointmen18_.aud_when, appointmen18_.aud_source, appointmen18_.aud_who_create, appointmen18_.aud_when_create, appointmen18_.aud_source_create
  • Buffers: shared hit=19 read=1
  • I/O Timings: read=7.333
47. 0.140 0.140 ↑ 1.0 8 20

Seq Scan on public.md_appointment_state appointmen19_ (cost=0.00..1.08 rows=8 width=33) (actual time=0.003..0.007 rows=8 loops=20)

  • Output: appointmen19_.id, appointmen19_.name, appointmen19_.code, appointmen19_.e_code, appointmen19_.aud_who, appointmen19_.aud_when, appointmen19_.aud_source, appointmen19_.aud_who_create, appointmen19_.aud_when_create, appointmen19_.aud_source_create, appointmen19_.from_dt, appointmen19_.to_dt
  • Buffers: shared hit=20
48.          

SubPlan (for Nested Loop)

49. 162.181 162.181 ↑ 1.0 1 157

Index Scan using md_appointment_pk on public.md_appointment a_1 (cost=0.56..8.59 rows=1 width=12) (actual time=1.033..1.033 rows=1 loops=157)

  • Output: CASE WHEN ((a_1.bdatetime < ('now'::cstring)::date) AND (a_1.state_id = ANY ('{0,2,5}'::integer[]))) THEN 6 ELSE appointmen0_.state_id END
  • Index Cond: (a_1.id = appointmen0_.id)
  • Buffers: shared hit=762 read=23
  • I/O Timings: read=159.341
50. 29.360 29.360 ↑ 1.0 1 20

Index Scan using sr_service_pk on public.sr_service service20_ (cost=0.42..6.02 rows=1 width=117) (actual time=1.465..1.468 rows=1 loops=20)

  • Output: service20_.id, service20_.code, service20_.cul, service20_.is_death, service20_.duration, service20_.is_fictitious, service20_.is_independent, service20_.is_multuplicity, service20_.name, service20_.terms, service20_.org_id, service20_.category_id, service20_.duration_unit_id, service20_.prototype_id, service20_.type_id, service20_.from_dt, service20_.to_dt, service20_.is_repeated, service20_.is_inherit_protocol, service20_.is_expendable_materials, service20_.is_actual_cul, service20_.is_paraclinical, service20_.is_complex, service20_.accounting_id, service20_.is_fact, service20_.is_autocopy_diagnoses, service20_.is_stomat, service20_.srg_dif_type_id, service20_.srg_opr_kind_id, service20_.is_need_anatomic_zone, service20_.aud_who, service20_.aud_when, service20_.aud_source, service20_.aud_who_create, service20_.aud_when_create, service20_.aud_source_create, service20_.is_filling, service20_.is_extraction, service20_.is_need_close_date, service20_.is_vmp, service20_.short_name, service20_.is_blocked_for_waitlist
  • Index Cond: (service20_.id = appointmen0_.service_id)
  • Filter: ((service20_.org_id <> ALL ('{33710,33709,33708}'::integer[])) OR (service20_.org_id = 36,988))
  • Buffers: shared hit=78 read=2
  • I/O Timings: read=28.804
51. 0.180 0.180 ↑ 1.0 10 20

Seq Scan on public.md_appointment_source appointmen21_ (cost=0.00..1.10 rows=10 width=25) (actual time=0.004..0.009 rows=10 loops=20)

  • Output: appointmen21_.id, appointmen21_.name, appointmen21_.code, appointmen21_.e_code, appointmen21_.aud_who, appointmen21_.aud_when, appointmen21_.aud_source, appointmen21_.aud_who_create, appointmen21_.aud_when_create, appointmen21_.aud_source_create, appointmen21_.from_dt, appointmen21_.to_dt
  • Buffers: shared hit=20
52.          

SubPlan (for Nested Loop)

53. 0.300 0.300 ↑ 1.0 1 20

Index Scan using md_appointment_pk on public.md_appointment a (cost=0.56..8.59 rows=1 width=12) (actual time=0.014..0.015 rows=1 loops=20)

  • Output: CASE WHEN ((a.bdatetime < ('now'::cstring)::date) AND (a.state_id = ANY ('{0,2,5}'::integer[]))) THEN 6 ELSE appointmen0_.state_id END
  • Index Cond: (a.id = appointmen0_.id)
  • Buffers: shared hit=100
54. 0.160 646.500 ↑ 1.0 1 20

Limit (cost=0.43..17.25 rows=1 width=15) (actual time=32.324..32.325 rows=1 loops=20)

  • Output: ic.code
  • Buffers: shared hit=54 read=77
  • I/O Timings: read=644.361
55. 0.320 646.340 ↑ 1.0 1 20

Nested Loop (cost=0.43..17.25 rows=1 width=15) (actual time=32.317..32.317 rows=1 loops=20)

  • Output: ic.code
  • Join Filter: (ic.type_id = ct.id)
  • Rows Removed by Join Filter: 2
  • Buffers: shared hit=54 read=77
  • I/O Timings: read=644.361
56. 0.260 0.260 ↑ 1.0 1 20

Seq Scan on public.pim_code_type ct (cost=0.00..1.41 rows=1 width=4) (actual time=0.013..0.013 rows=1 loops=20)

  • Output: ct.id, ct.code, ct.format, ct.from_dt, ct.is_unique, ct.message_pattern, ct.name, ct.note, ct.occurrence, ct.to_dt, ct.party_type_id, ct.e_code, ct.aud_who, ct.aud_when, ct.aud_source, ct.aud_who_create, ct.aud_when_create, ct.aud_source_create
  • Filter: ((ct.code)::text = 'UID'::text)
  • Rows Removed by Filter: 7
  • Buffers: shared hit=20
57. 645.760 645.760 ↑ 1.0 3 20

Index Scan using pim_indiv_code_indiv_id_idx on public.pim_indiv_code ic (cost=0.43..15.80 rows=3 width=19) (actual time=18.136..32.288 rows=3 loops=20)

  • Output: ic.id, ic.code, ic.issue_dt, ic.type_id, ic.indiv_id, ic.sha256, ic.aud_who, ic.aud_when, ic.aud_source, ic.aud_who_create, ic.aud_when_create, ic.aud_source_create
  • Index Cond: (ic.indiv_id = appointmen0_.customer_id)
  • Buffers: shared hit=34 read=77
  • I/O Timings: read=644.361
58. 0.060 505.400 ↑ 1.0 1 20

Limit (cost=0.99..20.35 rows=1 width=4) (actual time=25.269..25.270 rows=1 loops=20)

  • Output: pa.addr_id
  • Buffers: shared hit=122 read=82
  • I/O Timings: read=502.514
59. 0.242 505.340 ↑ 1.0 1 20

Nested Loop Semi Join (cost=0.99..20.35 rows=1 width=4) (actual time=25.267..25.267 rows=1 loops=20)

  • Output: pa.addr_id
  • Buffers: shared hit=122 read=82
  • I/O Timings: read=502.514
60. 0.300 504.720 ↑ 1.0 1 20

Nested Loop (cost=0.86..20.18 rows=1 width=8) (actual time=24.828..25.236 rows=1 loops=20)

  • Output: pa.addr_id, pat.address_type_id
  • Buffers: shared hit=80 read=82
  • I/O Timings: read=502.514
61. 129.360 129.360 ↑ 1.0 1 20

Index Scan using pim_party_address_party_id_idx on public.pim_party_address pa (cost=0.43..11.72 rows=1 width=8) (actual time=6.468..6.468 rows=1 loops=20)

  • Output: pa.id, pa.from_date, pa.note, pa.text_addr, pa.to_date, pa.is_valid, pa.addr_id, pa.party_id, pa.register_type_id, pa.aud_who, pa.aud_when, pa.aud_source, pa.aud_who_create, pa.aud_when_create, pa.aud_source_create
  • Index Cond: (pa.party_id = appointmen0_.customer_id)
  • Filter: pa.is_valid
  • Rows Removed by Filter: 0
  • Buffers: shared hit=41 read=40
  • I/O Timings: read=128.385
62. 375.060 375.060 ↑ 1.0 1 20

Index Scan using pim_party_addr_to_addr_type_party_address_id_idx on public.pim_party_addr_to_addr_type pat (cost=0.43..8.45 rows=1 width=8) (actual time=18.345..18.753 rows=1 loops=20)

  • Output: pat.id, pat.address_type_id, pat.party_address_id, pat.aud_who, pat.aud_when, pat.aud_source, pat.aud_who_create, pat.aud_when_create, pat.aud_source_create
  • Index Cond: (pat.party_address_id = pa.id)
  • Buffers: shared hit=39 read=42
  • I/O Timings: read=374.129
63. 0.378 0.378 ↑ 1.0 1 21

Index Scan using pim_address_type_pk on public.pim_address_type t (cost=0.13..0.15 rows=1 width=4) (actual time=0.018..0.018 rows=1 loops=21)

  • Output: t.id, t.code, t.name, t.note, t.party_type_id, t.e_code, t.aud_who, t.aud_when, t.aud_source, t.aud_who_create, t.aud_when_create, t.aud_source_create, t.from_dt, t.to_dt, t.is_unique, t.is_singular
  • Index Cond: (t.id = pat.address_type_id)
  • Filter: ((t.code)::text = ANY ('{ACTUAL,REGISTER}'::text[]))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=42
64. 0.140 601.060 ↑ 1.0 1 20

Result (cost=16.47..16.48 rows=1 width=0) (actual time=30.053..30.053 rows=1 loops=20)

  • Output: $8
  • Buffers: shared hit=38 read=42
  • I/O Timings: read=599.788
65.          

Initplan (for Result)

66. 0.100 600.920 ↑ 1.0 1 20

Limit (cost=0.43..16.47 rows=1 width=2) (actual time=30.045..30.046 rows=1 loops=20)

  • Output: ((patientreg22_.number_attach)::text)
  • Buffers: shared hit=38 read=42
  • I/O Timings: read=599.788
67. 600.820 600.820 ↑ 1.0 1 20

Index Scan Backward using pci_patient_reg_patient_id_number_attach_ix on public.pci_patient_reg patientreg22_ (cost=0.43..16.47 rows=1 width=2) (actual time=30.041..30.041 rows=1 loops=20)

  • Output: patientreg22_.number_attach
  • Index Cond: ((patientreg22_.patient_id = individual1_.id) AND ((patientreg22_.number_attach)::text IS NOT NULL))
  • Filter: (patientreg22_.clinic_id = resourcegr2_.org_id)
  • Buffers: shared hit=38 read=42
  • I/O Timings: read=599.788
68. 0.300 0.660 ↑ 1.0 1 20

Aggregate (cost=9.54..9.55 rows=1 width=4) (actual time=0.032..0.033 rows=1 loops=20)

  • Output: count(quarantine23_.id)
  • Buffers: shared hit=20
69. 0.100 0.360 ↓ 0.0 0 20

Bitmap Heap Scan on public.mc_quarantine_info quarantine23_ (cost=4.16..9.53 rows=1 width=4) (actual time=0.018..0.018 rows=0 loops=20)

  • Output: quarantine23_.id, quarantine23_.patient_id, quarantine23_.open_reason_id, quarantine23_.close_reason_id, quarantine23_.approve_date, quarantine23_.begin_dt, quarantine23_.end_dt, quarantine23_.is_deleted, quarantine23_.aud_who, quarantine23_.aud_when, quarantine23_.aud_source, quarantine23_.aud_who_create, quarantine23_.aud_when_create, quarantine23_.aud_source_create
  • Recheck Cond: (quarantine23_.patient_id = individual1_.id)
  • Filter: (((quarantine23_.is_deleted IS NULL) OR (NOT quarantine23_.is_deleted)) AND ((quarantine23_.begin_dt IS NOT NULL) OR (quarantine23_.end_dt IS NOT NULL)) AND (date(appointmen0_.bdatetime) >= COALESCE(quarantine23_.begin_dt, date(appointmen0_.bdatetime))) AND (date(appointmen0_.bdatetime) <= COALESCE(quarantine23_.end_dt, date(appointmen0_.bdatetime))))
  • Buffers: shared hit=20
70. 0.260 0.260 ↓ 0.0 0 20

Bitmap Index Scan on mc_quarantine_info_patient_id_idx (cost=0.00..4.16 rows=2 width=0) (actual time=0.013..0.013 rows=0 loops=20)

  • Index Cond: (quarantine23_.patient_id = individual1_.id)
  • Buffers: shared hit=20
Planning time : 169.477 ms
Execution time : 3,259.730 ms