SELECT * FROM ( SELECT DISTINCT ON ("patients".id) "patients".id, patients.id AS alias_0 FROM "patients" LEFT OUTER JOIN "address_details" ON "address_details"."addressable_id" = "patients"."id" AND "address_details"."addressable_type" = $1 WHERE (patients.extid not ilike $2) AND (address_details.mobile_no =$3) AND (patients.id in (select patient_id from visits where location_id = $4))) AS id_list ORDER BY id_list.alias_0 LIMIT $5 OFFSET $6
Total Time ms
Loading...
Average Time ms
Loading...
Calls
Loading...
Tables
| Name |
Rows |
Indexes |
| address_details |
388750 |
-
id
PRIMARY
-
addressable_id
-
addressable_id, addressable_type
-
addressable_id, addressable_type, id DESC
-
addressable_type
-
city_id
-
country_id
-
reference_1
|
| patients |
128968 |
-
id
PRIMARY
-
blood_group_id
-
extid
-
photograph_id
|
| visits |
378042 |
-
id
PRIMARY
-
extid
-
patient_id
|