Bug 682676 - Urlbar performance regression with SQLite 3.7.7.1.
authorMarco Bonardo <mbonardo@mozilla.com>
Thu, 01 Sep 2011 12:01:58 +0200
changeset 76374 1cbac1b072d5587986c0744e083f6fc47880b86a
parent 76373 bd97d56b0785823388fcae28bcd409fb63e81faf
child 76375 04545026b4ae067e8f2aeb7258ff1e09de458575
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
bugs682676
milestone9.0a1
Bug 682676 - Urlbar performance regression with SQLite 3.7.7.1. r=sdwilsh
toolkit/components/places/nsPlacesAutoComplete.js
--- a/toolkit/components/places/nsPlacesAutoComplete.js
+++ b/toolkit/components/places/nsPlacesAutoComplete.js
@@ -280,17 +280,20 @@ function nsPlacesAutoComplete()
   XPCOMUtils.defineLazyGetter(this, "_defaultQuery", function() {
     let replacementText = "";
     return this._db.createAsyncStatement(
       SQL_BASE.replace("{ADDITIONAL_CONDITIONS}", replacementText, "g")
     );
   });
 
   XPCOMUtils.defineLazyGetter(this, "_historyQuery", function() {
-    let replacementText = "AND h.visit_count > 0";
+    // Enforce ignoring the visit_count index, since the frecency one is much
+    // faster in this case.  ANALYZE helps the query planner to figure out the
+    // faster path, but it may not have run yet.
+    let replacementText = "AND +h.visit_count > 0";
     return this._db.createAsyncStatement(
       SQL_BASE.replace("{ADDITIONAL_CONDITIONS}", replacementText, "g")
     );
   });
 
   XPCOMUtils.defineLazyGetter(this, "_bookmarkQuery", function() {
     let replacementText = "AND bookmarked";
     return this._db.createAsyncStatement(