summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/contacts/SearchIndexManager.java
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2012-11-09 16:24:10 -0800
committerMakoto Onuki <omakoto@google.com>2012-11-14 17:24:15 -0800
commitf5c0020b87709f9c4c3de66a49c0893e2c2adebb (patch)
treefc02d1c278040e0058e8792541156bc98ac60aab /src/com/android/providers/contacts/SearchIndexManager.java
parent17f1fe1a960db78c84aaa753c784a4df513a1d3d (diff)
downloadpackages_providers_ContactsProvider-f5c0020b87709f9c4c3de66a49c0893e2c2adebb.zip
packages_providers_ContactsProvider-f5c0020b87709f9c4c3de66a49c0893e2c2adebb.tar.gz
packages_providers_ContactsProvider-f5c0020b87709f9c4c3de66a49c0893e2c2adebb.tar.bz2
Rebuild SQLITE_STAT1 table after drop operations.
The SQLITE_STAT1 table has the estimated number of rows for each table and index, which is used to calculate a query plan for queries. The problem is that, DROP TABLE and DROP INDEX appear to remove the corresponding row from the stats table. This could cause SQLite to choose inefficient query plans. This CL will make sure to rebuild the stats table after such operations. Added a new boolean paramter rebuildSqliteStats to all methods that exectue DROP TABLE/INDEX. If it's set, they'll call updateSqliteStats() to rebuild the contents. Bug 7426624 Change-Id: I1c373b902856d1a24b6c0c8379899a235ee284c4
Diffstat (limited to 'src/com/android/providers/contacts/SearchIndexManager.java')
-rw-r--r--src/com/android/providers/contacts/SearchIndexManager.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/providers/contacts/SearchIndexManager.java b/src/com/android/providers/contacts/SearchIndexManager.java
index 20fd16b..d45009e 100644
--- a/src/com/android/providers/contacts/SearchIndexManager.java
+++ b/src/com/android/providers/contacts/SearchIndexManager.java
@@ -271,7 +271,7 @@ public class SearchIndexManager {
final long start = SystemClock.elapsedRealtime();
int count = 0;
try {
- mDbHelper.createSearchIndexTable(db);
+ mDbHelper.createSearchIndexTable(db, true);
count = buildAndInsertIndex(db, null);
} finally {
mContactsProvider.setProviderStatus(ProviderStatus.STATUS_NORMAL);