explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6hhu

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 0.151 ↑ 1,231.0 2 1

Unique (cost=13,253.02..13,683.87 rows=2,462 width=580) (actual time=0.148..0.151 rows=2 loops=1)

2. 0.062 0.148 ↑ 1,231.0 2 1

Sort (cost=13,253.02..13,259.18 rows=2,462 width=580) (actual time=0.147..0.148 rows=2 loops=1)

  • Sort Key: patient0_.name, address3_.id, patient0_.patient_id, patient0_.created_at, patient0_.created_by, patient0_.migrated_from, patient0_.is_read_only, patient0_.is_sync, patient0_.updated_at, patient0_.updated_by, patient0_.version_id, patient0_.alias_name, patient0_.clinic_id, patient0_.date_of_birth, patient0_.date_of_marriage, patient0_.education_level_education_level_id, patient0_.email_address, patient0_.ethnic_group_ethnic_group_id, patient0_.ethnic_sub_group_sub_ethnic_group_id, patient0_.gender_gender_id, patient0_.government_staff, patient0_.has_pr, patient0_.house_hold_account_id, patient0_.is_baby, patient0_.is_dob_estimated, patient0_.is_malaysian_citizen, patient0_.is_pensioner, patient0_.is_temporary_registration, patient0_.is_unverified_registration, patient0_.linked_type, patient0_.marital_status_marital_status_id, patient0_.moh_staff, patient0_.my_hix_global_id, patient0_.nationality, patient0_.no_contact_number, patient0_.occupation_occupation_id, patient0_.patient_status, patient0_.pc_id, patient0_.pc_id_status, patient0_.pensioner_number, patient0_.pmi_number, patient0_.profile_id, patient0_.registration_date_time, patient0_.religion_religion_id, patient0_.remark, patient0_.temp_pc_id, address3_.created_at, address3_.created_by, address3_.migrated_from, address3_.is_read_only, address3_.is_sync, address3_.updated_at, address3_.updated_by, address3_.version_id, address3_.address1, address3_.address2, address3_.address3, address3_.address_type_address_type_id, address3_.country_id, address3_.is_deleted, address3_.district_district_id, address3_.gps_coordinate, address3_.mukim_id, address3_.patient_id, address3_.postal_code, address3_.state_id, address3_.villagetown_id
  • Sort Method: quicksort Memory: 26kB
3. 0.004 0.086 ↑ 1,231.0 2 1

Nested Loop Left Join (cost=39.47..13,114.34 rows=2,462 width=580) (actual time=0.064..0.086 rows=2 loops=1)

4. 0.007 0.064 ↑ 1,221.5 2 1

Hash Join (cost=39.05..11,872.38 rows=2,443 width=376) (actual time=0.052..0.064 rows=2 loops=1)

  • Hash Cond: (identifica1_.identity_type_id = identityty2_.identity_type_id)
5. 0.004 0.048 ↑ 1,221.5 2 1

Nested Loop (cost=37.78..11,837.52 rows=2,443 width=380) (actual time=0.036..0.048 rows=2 loops=1)

6. 0.006 0.026 ↑ 1,221.5 2 1

Bitmap Heap Scan on mst_pm_person_identification identifica1_ (cost=37.36..3,268.06 rows=2,443 width=12) (actual time=0.024..0.026 rows=2 loops=1)

  • Recheck Cond: (upper((identity_reference)::text) = '900519025268'::text)
  • Heap Blocks: exact=2
7. 0.020 0.020 ↑ 1,221.5 2 1

Bitmap Index Scan on mst_pm_person_identification_upper_identity_reference_idx (cost=0.00..36.75 rows=2,443 width=0) (actual time=0.020..0.020 rows=2 loops=1)

  • Index Cond: (upper((identity_reference)::text) = '900519025268'::text)
8. 0.018 0.018 ↑ 1.0 1 2

Index Scan using mst_pm_patient_patient_id_idx on mst_pm_patient patient0_ (cost=0.42..3.50 rows=1 width=376) (actual time=0.009..0.009 rows=1 loops=2)

  • Index Cond: (patient_id = identifica1_.patient_id)
9. 0.002 0.009 ↑ 1.0 12 1

Hash (cost=1.12..1.12 rows=12 width=4) (actual time=0.009..0.009 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
10. 0.007 0.007 ↑ 1.0 12 1

Seq Scan on ref_co_identity_type identityty2_ (cost=0.00..1.12 rows=12 width=4) (actual time=0.003..0.007 rows=12 loops=1)

11. 0.018 0.018 ↑ 1.0 1 2

Index Scan using mst_pm_address_patient_id_idx on mst_pm_address address3_ (cost=0.42..0.50 rows=1 width=204) (actual time=0.009..0.009 rows=1 loops=2)

  • Index Cond: (patient0_.patient_id = patient_id)
Planning time : 2.060 ms
Execution time : 0.332 ms