This changes order of graph pattern elements, moving OPTIONAL block to the end of the query. This gives a dramatic performance improvement. --- plugins/phonebook-tracker.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c index 1022d3a..80dfc02 100644 --- a/plugins/phonebook-tracker.c +++ b/plugins/phonebook-tracker.c @@ -161,6 +161,7 @@ "?_call a nmo:Call . " \ "?_unb_contact a nco:Contact . " \ "?_unb_contact nco:hasPhoneNumber ?_cpn . " \ +CONSTRAINT \ "OPTIONAL { " \ "{ SELECT ?_contact ?_cpn ?_role ?_number " \ "count(?_contact) as ?cnt " \ @@ -177,7 +178,6 @@ "} GROUP BY ?_cpn } " \ "FILTER(?cnt = 1) " \ "} " \ -CONSTRAINT \ "} " #define CALLS_LIST(CONSTRAINT) \ -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html