[tracker] tracker-miner-fs: Improve query performance for updating tracker:available on mounting
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-miner-fs: Improve query performance for updating tracker:available on mounting
- Date: Tue, 6 Sep 2011 10:15:27 +0000 (UTC)
commit 24fce27c8c5b9c6849252ccf20a8b9bbcaf1d94e
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 b7ac6a9..ba96fe5 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -810,9 +810,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;
@@ -838,8 +839,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]