tracker r2877 - in trunk: . data/db src/libtracker-data
- From: mottela svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2877 - in trunk: . data/db src/libtracker-data
- Date: Thu, 5 Feb 2009 00:45:52 +0000 (UTC)
Author: mottela
Date: Thu Feb 5 00:45:52 2009
New Revision: 2877
URL: http://svn.gnome.org/viewvc/tracker?rev=2877&view=rev
Log:
Rewrite of the database index scheme
Modified:
trunk/ChangeLog
trunk/data/db/sqlite-service.sql
trunk/src/libtracker-data/tracker-data-search.c
Modified: trunk/data/db/sqlite-service.sql
==============================================================================
--- trunk/data/db/sqlite-service.sql (original)
+++ trunk/data/db/sqlite-service.sql Thu Feb 5 00:45:52 2009
@@ -40,14 +40,6 @@
);
-/* Add indexes for Service table */
-CREATE INDEX ServiceTypeIndex1 ON Services (ServiceTypeID);
-CREATE INDEX ServiceAuxiliaryIDIndex1 ON Services (AuxilaryID);
-CREATE INDEX ServiceEnabledIndex1 ON Services (Enabled);
-CREATE INDEX ServiceKeyMetadata1Index1 ON Services (KeyMetadata1);
-CREATE INDEX ServiceKeyMetadata2Index1 ON Services (KeyMetadata2);
-CREATE INDEX ServiceKeyMetadata3Index1 ON Services (KeyMetadata3);
-
/* child service relationships for a specific group/struct metadata */
CREATE TABLE ChildServices
(
@@ -58,9 +50,6 @@
primary key (ParentID, ChildID, MetaDataID)
);
-CREATE INDEX ChildServicesIndex1 ON ChildServices (ChildID);
-
-
/* utf-8 based literal metadata. */
CREATE TABLE ServiceMetaData
(
@@ -72,8 +61,7 @@
);
-CREATE INDEX ServiceMetaDataIndex1 ON ServiceMetaData (ServiceID);
-CREATE INDEX ServiceMetaDataIndex2 ON ServiceMetaData (MetaDataID);
+CREATE INDEX ServiceMetaDataCompoundIndex ON ServiceMetaData (ServiceID, MetaDataID, MetaDataDisplay);
/* metadata for all keyword types - keywords are db indexed for fast searching - they are also not processed like other metadata. */
CREATE TABLE ServiceKeywordMetaData
@@ -84,9 +72,7 @@
MetaDataValue Text COLLATE NOCASE
);
-CREATE INDEX ServiceKeywordMetaDataIndex1 ON ServiceKeywordMetaData (MetaDataID, MetaDataValue);
-CREATE INDEX ServiceKeywordMetaDataIndex2 ON ServiceKeywordMetaData (ServiceID);
-
+CREATE INDEX ServiceKeywordMetaDataCompoundIndex ON ServiceKeywordMetaData (ServiceID, MetaDataID, MetaDataValue);
/* metadata for all integer/date types */
CREATE TABLE ServiceNumericMetaData
@@ -97,8 +83,5 @@
MetaDataValue Integer not null
);
-CREATE INDEX ServiceNumericMetaDataIndex1 ON ServiceNumericMetaData (MetaDataID, MetaDataValue);
-CREATE INDEX ServiceNumericMetaDataIndex2 ON ServiceNumericMetaData (ServiceID);
-
-
+CREATE INDEX ServiceNumericMetaDataCompoundIndex ON ServiceNumericMetaData (ServiceID, MetaDataID, MetaDataValue);
Modified: trunk/src/libtracker-data/tracker-data-search.c
==============================================================================
--- trunk/src/libtracker-data/tracker-data-search.c (original)
+++ trunk/src/libtracker-data/tracker-data-search.c Thu Feb 5 00:45:52 2009
@@ -767,7 +767,7 @@
for (i = 0; i < g_strv_length (fields); i++) {
TrackerFieldData *fd;
- fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, fields[i], TRUE, TRUE);
+ fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, fields[i], FALSE, TRUE);
if (!fd) {
g_string_free (sql_select, TRUE);
@@ -891,7 +891,7 @@
for (i = 0; i < g_strv_length (fields); i++) {
TrackerFieldData *fd;
- fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, fields[i], TRUE, TRUE);
+ fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, fields[i], FALSE, TRUE);
if (!fd) {
g_string_free (sql_select, TRUE);
@@ -924,7 +924,7 @@
TrackerFieldData *fd;
if (strcmp (count_field, "*")) {
- fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, count_field, TRUE, TRUE);
+ fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, count_field, FALSE, TRUE);
if (!fd) {
g_string_free (sql_select, TRUE);
@@ -1051,7 +1051,7 @@
for (i = 0; i < g_strv_length (fields); i++) {
TrackerFieldData *fd;
- fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, fields[i], TRUE, TRUE);
+ fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, fields[i], FALSE, TRUE);
if (!fd) {
g_string_free (sql_select, TRUE);
@@ -1084,7 +1084,7 @@
TrackerFieldData *fd;
if (strcmp (count_field, "*")) {
- fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, count_field, TRUE, TRUE);
+ fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, count_field, FALSE, TRUE);
if (!fd) {
g_string_free (sql_select, TRUE);
@@ -1109,7 +1109,7 @@
TrackerFieldData *fd;
TrackerFieldType data_type;
- fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, sum_field, TRUE, TRUE);
+ fd = tracker_metadata_add_metadata_field (iface, service_type, &field_list, sum_field, FALSE, TRUE);
if (!fd) {
g_string_free (sql_select, TRUE);
@@ -1234,7 +1234,7 @@
sql_from = g_string_new ("\nFROM Services AS S ");
sql_where = g_string_new ("\nWHERE ");
- fd = tracker_metadata_add_metadata_field (iface, service_type, &fields, field, TRUE, TRUE);
+ fd = tracker_metadata_add_metadata_field (iface, service_type, &fields, field, FALSE, TRUE);
if (!fd) {
g_string_free (sql_select, TRUE);
@@ -1344,7 +1344,7 @@
sql_where = g_string_new ("\nWHERE ");
if (strcmp (field, "*")) {
- fd = tracker_metadata_add_metadata_field (iface, service_type, &fields, field, TRUE, TRUE);
+ fd = tracker_metadata_add_metadata_field (iface, service_type, &fields, field, FALSE, TRUE);
if (!fd) {
g_string_free (sql_select, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]