[PATCH] Optimise call history queries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux