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
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
index 9273c5a..8f1253a 100644
--- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java
+++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java
@@ -597,6 +597,8 @@
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 + " ("+