[tracker/tracker-0.10] tracker-miner-fs: Improve query performance for updating tracker:available on mounting



commit 4cbe85beb1af849a65fe0cf8facd4c36478db730
Author: Martyn Russell <martyn lanedo com>
Date:   Tue Sep 6 11:12:03 2011 +0100

    tracker-miner-fs: Improve query performance for updating tracker:available on mounting
    
    Previously we had an OPTIONAL and FILTER in the query. This translated into
    quite a delay when updating even a small number of resources in the database
    and subsequently affected the crawling speed upon re-mounting.
    
    Given we don't *ever* expect there to be resources for the given
    nie:dataSource which are in the wrong tracker:available state, we don't need
    the OPTIONAL or FILTER there.
    
    This fixes NB#272441

 src/miners/fs/tracker-miner-files.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index 33d7148..5ea4f65 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -833,9 +833,10 @@ set_up_mount_point (TrackerMinerFiles *miner,
                                                 "INSERT INTO <%s> { <%s> a tracker:Volume; tracker:isMounted true } ",
                                                 removable_device_urn, removable_device_urn);
                 }
-		g_string_append_printf (queries,
-		                        "INSERT { GRAPH <%s> { ?do tracker:available true } } WHERE { ?do nie:dataSource <%s> OPTIONAL { ?do tracker:available ?available } FILTER (!bound(?available)) } ",
-		                        removable_device_urn, removable_device_urn);
+
+                g_string_append_printf (queries,
+                                        "INSERT { GRAPH <%s> { ?do tracker:available true } } WHERE { ?do nie:dataSource <%s> } ",
+                                        removable_device_urn, removable_device_urn);
 	} else {
 		gchar *now;
 
@@ -861,8 +862,9 @@ set_up_mount_point (TrackerMinerFiles *miner,
 		                        removable_device_urn, removable_device_urn);
 
 		g_string_append_printf (queries,
-		                        "DELETE { ?do tracker:available true } WHERE { ?do nie:dataSource <%s> ; tracker:available true } ",
+		                        "DELETE { ?do tracker:available true } WHERE { ?do nie:dataSource <%s> } ",
 		                        removable_device_urn);
+
 		g_free (now);
 	}
 



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