From df0740c34e4b4605831523d153969ccf89f007c3 Mon Sep 17 00:00:00 2001 From: Slawomir Bochenski Date: Fri, 12 Aug 2011 15:18:48 +0200 Subject: [PATCH] obexd: phonebook-tracker.c: Calls query speed-up Another change regarding performance of call history queries. This makes them non-sensitive (in terms of speed) to the corner case situations when there are hundreds of contacts all having the same phone number. --- obexd/plugins/phonebook-tracker.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/obexd/plugins/phonebook-tracker.c b/obexd/plugins/phonebook-tracker.c index 8bc070f14..875901ce1 100644 --- a/obexd/plugins/phonebook-tracker.c +++ b/obexd/plugins/phonebook-tracker.c @@ -164,7 +164,7 @@ "?_unb_contact nco:hasPhoneNumber ?_cpn . " \ CONSTRAINT \ "OPTIONAL { " \ - "{ SELECT ?_contact ?_cpn ?_role ?_number " \ + "{ SELECT ?_contact ?_no ?_role ?_number " \ "count(?_contact) as ?cnt " \ "WHERE { " \ "?_contact a nco:PersonContact . " \ @@ -175,9 +175,9 @@ CONSTRAINT \ "?_contact nco:hasPhoneNumber ?_number" \ "} " \ "?_number maemo:localPhoneNumber ?_no . " \ - "?_cpn maemo:localPhoneNumber ?_no . " \ - "} GROUP BY ?_cpn } " \ + "} GROUP BY ?_no } " \ "FILTER(?cnt = 1) " \ + "?_cpn maemo:localPhoneNumber ?_no . " \ "} " \ "} " -- 2.47.3