[tracker/domain-specific-indexes-review: 4/13] libtracker-data: Added debugging output
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/domain-specific-indexes-review: 4/13] libtracker-data: Added debugging output
- Date: Tue, 6 Jul 2010 11:49:48 +0000 (UTC)
commit ae3b016bcbb11dad59295551f5a20dfac17b6891
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Jul 1 14:42:32 2010 +0200
libtracker-data: Added debugging output
src/libtracker-data/tracker-data-manager.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 257fdd2..5d8ec32 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -112,12 +112,18 @@ set_secondary_index_for_single_value_property (TrackerDBInterface *iface,
const gchar *second_field_name,
gboolean enabled)
{
+ g_debug ("Dropping index: DROP INDEX IF EXISTS \"%s_%s\"",
+ service_name, field_name);
+
tracker_db_interface_execute_query (iface, NULL,
"DROP INDEX IF EXISTS \"%s_%s\"",
service_name,
field_name);
if (enabled) {
+ g_debug ("Creating index: CREATE INDEX \"%s_%s\" ON \"%s\" (\"%s\", \"%s\")",
+ service_name, field_name, service_name, field_name, second_field_name);
+
tracker_db_interface_execute_query (iface, NULL,
"CREATE INDEX \"%s_%s\" ON \"%s\" (\"%s\", \"%s\")",
service_name,
@@ -134,12 +140,18 @@ set_index_for_single_value_property (TrackerDBInterface *iface,
const gchar *field_name,
gboolean enabled)
{
+ g_debug ("Dropping index: DROP INDEX IF EXISTS \"%s_%s\"",
+ service_name, field_name);
+
tracker_db_interface_execute_query (iface, NULL,
"DROP INDEX IF EXISTS \"%s_%s\"",
service_name,
field_name);
if (enabled) {
+ g_debug ("Creating index: CREATE INDEX \"%s_%s\" ON \"%s\" (\"%s\")",
+ service_name, field_name, service_name, field_name);
+
tracker_db_interface_execute_query (iface, NULL,
"CREATE INDEX \"%s_%s\" ON \"%s\" (\"%s\")",
service_name,
@@ -1964,6 +1976,8 @@ copy_from_domain_to_domain_index (TrackerDBInterface *iface,
source_name,
dest_name);
+ g_debug ("Copying: '%s'", query);
+
tracker_db_interface_execute_query (iface, &error, "%s", query);
if (error) {
@@ -2152,6 +2166,7 @@ create_decomposed_metadata_tables (TrackerDBInterface *iface,
if (tracker_property_get_is_inverse_functional_property (property)) {
g_string_append (alter_sql, " UNIQUE");
}
+ g_debug ("Altering: '%s'", alter_sql->str);
tracker_db_interface_execute_query (iface, &error, "%s", alter_sql->str);
if (error) {
g_critical ("Ontology change failed while altering SQL table '%s'", error->message);
@@ -2172,6 +2187,7 @@ create_decomposed_metadata_tables (TrackerDBInterface *iface,
g_string_append_printf (alter_sql, "\"%s\" ADD COLUMN \"%s:graph\" INTEGER",
service_name,
field_name);
+ g_debug ("Altering: '%s'", alter_sql->str);
tracker_db_interface_execute_query (iface, &error, "%s", alter_sql->str);
if (error) {
g_critical ("Ontology change failed while altering SQL table '%s'", error->message);
@@ -2189,6 +2205,7 @@ create_decomposed_metadata_tables (TrackerDBInterface *iface,
g_string_append_printf (alter_sql, "\"%s\" ADD COLUMN \"%s:localDate\" INTEGER",
service_name,
field_name);
+ g_debug ("Altering: '%s'", alter_sql->str);
tracker_db_interface_execute_query (iface, &error, "%s", alter_sql->str);
if (error) {
g_critical ("Ontology change failed while altering SQL table '%s'", error->message);
@@ -2206,6 +2223,7 @@ create_decomposed_metadata_tables (TrackerDBInterface *iface,
g_string_append_printf (alter_sql, "\"%s\" ADD COLUMN \"%s:localTime\" INTEGER",
service_name,
field_name);
+ g_debug ("Altering: '%s'", alter_sql->str);
tracker_db_interface_execute_query (iface, &error, "%s", alter_sql->str);
if (error) {
g_critical ("Ontology change failed while altering SQL table '%s'", error->message);
@@ -2232,6 +2250,7 @@ create_decomposed_metadata_tables (TrackerDBInterface *iface,
if (create_sql) {
g_string_append (create_sql, ")");
+ g_debug ("Creating: '%s'", create_sql->str);
tracker_db_interface_execute_query (iface, NULL, "%s", create_sql->str);
g_string_free (create_sql, TRUE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]