aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasu Nori <vnori@google.com>2010-10-18 12:18:52 -0700
committerVasu Nori <vnori@google.com>2010-10-18 12:18:52 -0700
commit09562b6c3a420ded0d02b9bd2290de2dbab9e304 (patch)
tree08002b14381f5a4f9ffc0d832d95cae9a7871899
parent117166d023b9d9405f18cc5222b18fd16a13660c (diff)
downloadContactsProvider-09562b6c3a420ded0d02b9bd2290de2dbab9e304.tar.gz
bug:3097939 trigger on a table without good index = slow contacts app
added index on a table without which the contacts app trigger is causing N**2 linear scans of the contacts table. the bigger the contacts table size (= N), the worse the prlblem is. Change-Id: I5124b3b43d929ccaca3c4f4261c16b0ee5f02d61
-rw-r--r--src/com/android/providers/contacts/ContactsDatabaseHelper.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
index 9273c5ae..8f1253ad 100644
--- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java
+++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
@@ -597,6 +597,8 @@ import java.util.Locale;
db.execSQL("CREATE INDEX IF NOT EXISTS " + DATABASE_PRESENCE + ".presenceIndex" + " ON "
+ Tables.PRESENCE + " (" + PresenceColumns.RAW_CONTACT_ID + ");");
+ db.execSQL("CREATE INDEX IF NOT EXISTS " + DATABASE_PRESENCE + ".presenceIndex2" + " ON "
+ + Tables.PRESENCE + " (" + PresenceColumns.CONTACT_ID + ");");
db.execSQL("CREATE TABLE IF NOT EXISTS "
+ DATABASE_PRESENCE + "." + Tables.AGGREGATED_PRESENCE + " ("+