[tracker/store-memory] tracker-miner-fs: Improve efficiency of tracker:available updates



commit 0a50d6741ec3c12350b0b71264b015cab218489c
Author: Jürg Billeter <j bitron ch>
Date:   Tue Mar 2 12:57:38 2010 +0100

    tracker-miner-fs: Improve efficiency of tracker:available updates
    
    INSERT/DELETE {...} WHERE {...} with many solutions where no change is
    necessary causes initialization to require more time and memory.

 src/tracker-miner-fs/tracker-miner-files.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-miner-fs/tracker-miner-files.c b/src/tracker-miner-fs/tracker-miner-files.c
index 9c15dd1..7e50178 100644
--- a/src/tracker-miner-fs/tracker-miner-files.c
+++ b/src/tracker-miner-fs/tracker-miner-files.c
@@ -540,7 +540,7 @@ set_up_mount_point (TrackerMinerFiles *miner,
 		                        removable_device_urn, removable_device_urn);
 
 		g_string_append_printf (queries,
-		                        "INSERT INTO <%s> { ?do tracker:available true } WHERE { ?do nie:dataSource <%s> } ",
+		                        "INSERT INTO <%s> { ?do tracker:available true } WHERE { ?do nie:dataSource <%s> OPTIONAL { ?do tracker:available ?available } FILTER (!bound(?available)) } ",
 		                        removable_device_urn, removable_device_urn);
 	} else {
 		gchar *now;
@@ -564,7 +564,7 @@ set_up_mount_point (TrackerMinerFiles *miner,
 		                        removable_device_urn, removable_device_urn);
 
 		g_string_append_printf (queries,
-		                        "DELETE FROM <%s> { ?do tracker:available true } WHERE { ?do nie:dataSource <%s> } ",
+		                        "DELETE FROM <%s> { ?do tracker:available true } WHERE { ?do nie:dataSource <%s> ; tracker:available true } ",
 		                        removable_device_urn, removable_device_urn);
 		g_free (now);
 	}



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