tracker r1792 - in branches/indexer-split: . tests/libtracker-db
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1792 - in branches/indexer-split: . tests/libtracker-db
- Date: Fri, 27 Jun 2008 11:53:36 +0000 (UTC)
Author: pvanhoof
Date: Fri Jun 27 11:53:35 2008
New Revision: 1792
URL: http://svn.gnome.org/viewvc/tracker?rev=1792&view=rev
Log:
2008-06-27 Philip Van Hoof <pvanhoof gnome org>
* tests/libtracker-db/union-performance.c: Added a performance test
for a UNION query structure vs. views that me and ottela want to
start using for certain Xesam related queries
Added:
branches/indexer-split/tests/libtracker-db/union-performance.c
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/tests/libtracker-db/Makefile.am
Modified: branches/indexer-split/tests/libtracker-db/Makefile.am
==============================================================================
--- branches/indexer-split/tests/libtracker-db/Makefile.am (original)
+++ branches/indexer-split/tests/libtracker-db/Makefile.am Fri Jun 27 11:53:35 2008
@@ -2,7 +2,10 @@
noinst_PROGRAMS = $(TEST_PROGS)
-TEST_PROGS += tracker-db-manager-unattach tracker-db-manager-attach tracker-db-manager-custom
+TEST_PROGS += tracker-db-manager-unattach \
+ tracker-db-manager-attach \
+ tracker-db-manager-custom \
+ union-performance
INCLUDES = \
-g \
@@ -17,6 +20,19 @@
$(GLIB2_CFLAGS)
+union_performance_SOURCES = union-performance.c
+
+union_performance_LDADD = \
+ $(top_builddir)/src/libtracker-db/libtracker-db.la \
+ $(top_builddir)/src/libtracker-common/libtracker-common.la \
+ $(top_builddir)/tests/common/libtracker-testcommon.la \
+ $(top_builddir)/src/xdgmime/libxdgmime.la \
+ $(SQLITE3_LIBS) \
+ $(QDBM_LIBS) \
+ $(GMODULE_LIBS) \
+ $(GTHREAD_LIBS) \
+ $(GLIB2_LIBS) \
+ -lz
tracker_db_manager_attach_SOURCES = \
tracker-db-manager-test-attach.c \
Added: branches/indexer-split/tests/libtracker-db/union-performance.c
==============================================================================
--- (empty file)
+++ branches/indexer-split/tests/libtracker-db/union-performance.c Fri Jun 27 11:53:35 2008
@@ -0,0 +1,84 @@
+#include <glib.h>
+#include <glib/gtestutils.h>
+
+
+#include <libtracker-db/tracker-db-manager.h>
+#include "tracker-db-manager-common.h"
+
+
+
+static void
+test_union_performance_xesam ()
+{
+ TrackerDBInterface *iface;
+ TrackerDBResultSet *result_set;
+ GError *error = NULL;
+
+ iface = tracker_db_manager_get_db_interfaces (7, TRACKER_DB_COMMON,
+ TRACKER_DB_XESAM,
+ TRACKER_DB_FILE_METADATA,
+ TRACKER_DB_FILE_CONTENTS,
+ TRACKER_DB_EMAIL_CONTENTS,
+ TRACKER_DB_EMAIL_METADATA,
+ TRACKER_DB_CACHE);
+
+ g_assert (iface);
+
+ result_set = tracker_db_interface_execute_query (iface, &error,
+ "CREATE TEMPORARY VIEW XesamServicesView AS SELECT * FROM 'file-meta'.Services UNION SELECT * FROM 'email-meta'.Services");
+ if (result_set)
+ g_object_unref (result_set);
+
+ g_assert (!error);
+
+ result_set = tracker_db_interface_execute_query (iface, &error,
+ "CREATE TEMPORARY VIEW XesamServiceMetaDataView AS SELECT * FROM 'file-meta'.ServiceMetaData UNION SELECT * FROM 'email-meta'.ServiceMetaData");
+ if (result_set)
+ g_object_unref (result_set);
+
+ g_assert (!error);
+
+ /* TODO: Start timer */
+ result_set = tracker_db_interface_execute_query (iface, &error,
+ "SELECT M0.MetaDataValue "
+ "FROM XesamServicesView S "
+ "INNER JOIN XesamServiceMetaDataView M0 ON (S.ID = M0.ServiceID and "
+ "M0.MetaDataID in (82)) WHERE (S.ServiceTypeID in (select TypeId from "
+ "ServiceTypes where TypeName = 'Files' or Parent = 'Files')) AND "
+ " ( (M0.MetaDataValue like '%%test%%') )");
+
+ /* TODO: Stop timer */
+ if (result_set)
+ g_object_unref (result_set);
+
+ g_assert (!error);
+
+ g_object_unref (iface);
+}
+
+
+
+int
+main (int argc, char **argv)
+{
+ int result;
+ gint first_time;
+
+ g_type_init ();
+ g_thread_init (NULL);
+ g_test_init (&argc, &argv, NULL);
+
+ /* Init */
+ tracker_db_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
+ &first_time);
+
+ g_test_add_func ("/libtracker-db/union-performance/xesam",
+ test_union_performance_xesam);
+
+ result = g_test_run ();
+
+ /* End */
+ tracker_db_manager_shutdown (TRUE);
+
+ return result;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]