tracker r1729 - in branches/indexer-split: data src/libtracker-db



Author: pvanhoof
Date: Fri Jun 20 15:07:36 2008
New Revision: 1729
URL: http://svn.gnome.org/viewvc/tracker?rev=1729&view=rev

Log:
2008-06-20  Philip Van Hoof  <pvanhoof gnome org>

        * src/libtracker-db/tracker-db-manager.c:
        * data/sqlite-service-triggers.sql:
        * data/sqlite-tracker-triggers.sql:

        Using a transaction around database initializations. This speeds up
        initialization, makes it more robust (what if we get killed while
        initializing) and it seems to avoid a call for fsync() when we have
        PRAGMA synchronous = NORMAL (which we currently do have for all
        database connections).

        Point of opinion about this commit: we should utilize transactions more
        often in the code. It helps us avoid corruption and massively speeds up
        INSERTs and UPDATEs:

        http://www.sqlite.org/speed.html:

        At Executive Summary: SQLite works best if you group multiple
        operations together into a single transaction.

	continued



Modified:
   branches/indexer-split/data/sqlite-stored-procs.sql
   branches/indexer-split/src/libtracker-db/tracker-db-manager.c

Modified: branches/indexer-split/data/sqlite-stored-procs.sql
==============================================================================
--- branches/indexer-split/data/sqlite-stored-procs.sql	(original)
+++ branches/indexer-split/data/sqlite-stored-procs.sql	Fri Jun 20 15:07:36 2008
@@ -25,7 +25,7 @@
 GetNewID SELECT OptionValue FROM Options WHERE OptionKey = 'Sequence';
 UpdateNewID UPDATE Options set OptionValue = ? WHERE OptionKey = 'Sequence';
 CreateEvent INSERT INTO Events (ID, ServiceID, EventType) VALUES (?,?,?); 
-DeleteHandledEvents DELETE FROM Events WHERE BeingHandled = 1;
+DeleteHandledEvents DELETE FROM cache.Events WHERE BeingHandled = 1;
 GetEvents SELECT ID, ServiceID, EventType FROM Events WHERE BeingHandled = 1;
 SetEventsBeingHandled UPDATE Events SET BeingHandled = 1;
 

Modified: branches/indexer-split/src/libtracker-db/tracker-db-manager.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-manager.c	(original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-manager.c	Fri Jun 20 15:07:36 2008
@@ -2049,17 +2049,17 @@
 	}
 
 	if (create) {
-		load_sql_file (attach_iface, "sqlite-xesam.sql", NULL);
-		
-		load_service_file_xesam (attach_iface, "xesam.metadata");
-		load_service_file_xesam (attach_iface, "xesam-convenience.metadata");
-		load_service_file_xesam (attach_iface, "xesam-virtual.metadata");
-		load_service_file_xesam (attach_iface, "xesam.service");
-		load_service_file_xesam (attach_iface, "xesam-convenience.service");
-		load_service_file_xesam (attach_iface, "xesam-service.smapping");
-		load_service_file_xesam (attach_iface, "xesam-metadata.mmapping");
-		
-		db_xesam_create_lookup (attach_iface);
+		tracker_db_interface_start_transaction (iface);
+		load_sql_file (iface, "sqlite-xesam.sql", NULL);
+		load_service_file_xesam (iface, "xesam.metadata");
+		load_service_file_xesam (iface, "xesam-convenience.metadata");
+		load_service_file_xesam (iface, "xesam-virtual.metadata");
+		load_service_file_xesam (iface, "xesam.service");
+		load_service_file_xesam (iface, "xesam-convenience.service");
+		load_service_file_xesam (iface, "xesam-service.smapping");
+		load_service_file_xesam (iface, "xesam-metadata.mmapping");
+		db_xesam_create_lookup (iface);
+		tracker_db_interface_end_transaction (iface);
 	}
 
 	/* Load static xesam data */



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