diff options
author | Dmitri Plotnikov <dplotnikov@google.com> | 2009-09-24 13:50:27 -0700 |
---|---|---|
committer | Dmitri Plotnikov <dplotnikov@google.com> | 2009-09-24 13:50:27 -0700 |
commit | 8fddc066662d58e8d6a436decb8dafbf28ce652e (patch) | |
tree | 2432cff137d0c87d749c632e9d670a12251fe222 /src | |
parent | a23cd5b6f478f6c9dda54173e84bd0098b9f3364 (diff) | |
download | ContactsProvider-8fddc066662d58e8d6a436decb8dafbf28ce652e.tar.gz |
[Issue 2138752] Improving performance of sync and contacts UI by fixing stats in the sqlite3.db
The main problem was that an index name was only updated in one place by my
CL https://android-git.corp.google.com/g/#change,26082
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/providers/contacts/OpenHelper.java | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/src/com/android/providers/contacts/OpenHelper.java b/src/com/android/providers/contacts/OpenHelper.java index dc7dee42..df49f794 100644 --- a/src/com/android/providers/contacts/OpenHelper.java +++ b/src/com/android/providers/contacts/OpenHelper.java @@ -1213,15 +1213,39 @@ import java.util.HashMap; // Specific stats strings are based on an actual large database after running ANALYZE try { - updateIndexStats(db, Tables.RAW_CONTACTS, "raw_contacts_source_id_index", "10000 1 1 1"); - updateIndexStats(db, Tables.RAW_CONTACTS, "raw_contacts_contact_id_index", "10000 2"); - updateIndexStats(db, Tables.NAME_LOOKUP, "name_lookup_raw_contact_id_index", "10000 3"); - updateIndexStats(db, Tables.NAME_LOOKUP, "name_lookup_index", "10000 3 2 2"); - updateIndexStats(db, Tables.NAME_LOOKUP, "sqlite_autoindex_name_lookup_1", "10000 3 2 1"); - updateIndexStats(db, Tables.PHONE_LOOKUP, "phone_lookup_index", "10000 2 2 1"); - updateIndexStats(db, Tables.DATA, "data_mimetype_data2_index", "10000 1000 2"); - updateIndexStats(db, Tables.DATA, "data_raw_contact_id", "10000 10"); - updateIndexStats(db, Tables.GROUPS, "groups_source_id_index", "50 1 1 1"); + updateIndexStats(db, Tables.CONTACTS, + "contacts_restricted_index", "10000 9000"); + updateIndexStats(db, Tables.CONTACTS, + "contacts_has_phone_index", "10000 500"); + updateIndexStats(db, Tables.CONTACTS, + "contacts_visible_index", "10000 500"); + + updateIndexStats(db, Tables.RAW_CONTACTS, + "raw_contacts_source_id_index", "10000 1 1 1"); + updateIndexStats(db, Tables.RAW_CONTACTS, + "raw_contacts_contact_id_index", "10000 2"); + + updateIndexStats(db, Tables.NAME_LOOKUP, + "name_lookup_raw_contact_id_index", "10000 3"); + updateIndexStats(db, Tables.NAME_LOOKUP, + "name_lookup_index", "10000 3 2 2"); + updateIndexStats(db, Tables.NAME_LOOKUP, + "sqlite_autoindex_name_lookup_1", "10000 3 2 1"); + + updateIndexStats(db, Tables.PHONE_LOOKUP, + "phone_lookup_index", "10000 2 2 1"); + + updateIndexStats(db, Tables.DATA, + "data_mimetype_data1_index", "60000 5000 2"); + updateIndexStats(db, Tables.DATA, + "data_raw_contact_id", "60000 10"); + + updateIndexStats(db, Tables.GROUPS, + "groups_source_id_index", "50 1 1 1"); + + updateIndexStats(db, Tables.NICKNAME_LOOKUP, + "sqlite_autoindex_name_lookup_1", "500 2 1"); + } catch (SQLException e) { Log.e(TAG, "Could not update index stats", e); } |