[evolution-data-server] Bug 699597 - EBookSqlite: Add indices on family_name, nickname, given_name and file_as
- From: dwmw2 <dwmw2 src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 699597 - EBookSqlite: Add indices on family_name, nickname, given_name and file_as
- Date: Thu, 9 Oct 2014 12:22:14 +0000 (UTC)
commit 49d3167d5ceb03ced1fa060c783704e657e91c61
Author: David Woodhouse <David Woodhouse intel com>
Date: Mon Sep 15 06:22:31 2014 -0700
Bug 699597 - EBookSqlite: Add indices on family_name, nickname, given_name and file_as
The Evolution address autocompletion uses these, and we really want it to
be fast. So enable indices on the *unlocalised* column by default.
addressbook/libedata-book/e-book-sqlite.c | 33 ++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-sqlite.c b/addressbook/libedata-book/e-book-sqlite.c
index f0968c1..1cbf146 100644
--- a/addressbook/libedata-book/e-book-sqlite.c
+++ b/addressbook/libedata-book/e-book-sqlite.c
@@ -245,7 +245,7 @@ ebsql_init_debug (void)
} \
} G_STMT_END
-#define FOLDER_VERSION 9
+#define FOLDER_VERSION 10
#define INSERT_MULTI_STMT_BYTES 128
#define COLUMN_DEFINITION_BYTES 32
#define GENERATED_QUERY_BYTES 1024
@@ -428,6 +428,10 @@ static EContactField default_summary_fields[] = {
*/
static EContactField default_indexed_fields[] = {
E_CONTACT_FULL_NAME,
+ E_CONTACT_NICKNAME,
+ E_CONTACT_FILE_AS,
+ E_CONTACT_GIVEN_NAME,
+ E_CONTACT_FAMILY_NAME,
E_CONTACT_EMAIL,
E_CONTACT_FILE_AS,
E_CONTACT_FAMILY_NAME,
@@ -437,6 +441,10 @@ static EContactField default_indexed_fields[] = {
static EBookIndexType default_index_types[] = {
E_BOOK_INDEX_PREFIX,
E_BOOK_INDEX_PREFIX,
+ E_BOOK_INDEX_PREFIX,
+ E_BOOK_INDEX_PREFIX,
+ E_BOOK_INDEX_PREFIX,
+ E_BOOK_INDEX_PREFIX,
E_BOOK_INDEX_SORT_KEY,
E_BOOK_INDEX_SORT_KEY,
E_BOOK_INDEX_SORT_KEY
@@ -2326,6 +2334,29 @@ ebsql_introspect_summary (EBookSqlite *ebsql,
E_CONTACT_X509_CERT, NULL);
}
}
+
+ if (previous_schema < 10) {
+ if ((i = summary_field_array_index (summary_fields, E_CONTACT_NICKNAME)) >= 0) {
+ summary_field = &g_array_index (summary_fields, SummaryField, i);
+ summary_field->index |= INDEX_FLAG (PREFIX);
+ }
+
+ if ((i = summary_field_array_index (summary_fields, E_CONTACT_FILE_AS)) >= 0) {
+ summary_field = &g_array_index (summary_fields, SummaryField, i);
+ summary_field->index |= INDEX_FLAG (PREFIX);
+ }
+
+ if ((i = summary_field_array_index (summary_fields, E_CONTACT_GIVEN_NAME)) >= 0) {
+ summary_field = &g_array_index (summary_fields, SummaryField, i);
+ summary_field->index |= INDEX_FLAG (PREFIX);
+ }
+
+ if ((i = summary_field_array_index (summary_fields, E_CONTACT_FAMILY_NAME)) >= 0) {
+ summary_field = &g_array_index (summary_fields, SummaryField, i);
+ summary_field->index |= INDEX_FLAG (PREFIX);
+ }
+
+ }
}
introspect_summary_finish:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]