Bug 1318650 - Searching Places views by url became extremely slow. r=adw, a=gchang
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 18 Nov 2016 16:51:27 +0100
changeset 358931 929e6cabdaa5a909985797b8e2b4e41a38e4bc66
parent 358930 0f6a643ab177f2e5d5769612ab669f9fea39b8a1
child 358932 f8cd956e52d6e2ab6c2d3fb802f5aaef544f0d32
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw, gchang
bugs1318650
milestone51.0
Bug 1318650 - Searching Places views by url became extremely slow. r=adw, a=gchang MozReview-Commit-ID: 67SztEKHCn
toolkit/components/places/nsNavHistory.cpp
--- a/toolkit/components/places/nsNavHistory.cpp
+++ b/toolkit/components/places/nsNavHistory.cpp
@@ -3256,17 +3256,18 @@ nsNavHistory::QueryToSelectClause(nsNavH
     else
       // see domain setting in BindQueryClauseParameters for why we do this
       clause.Condition("h.rev_host >=").Param(":domain_lower")
             .Condition("h.rev_host <").Param(":domain_upper");
   }
 
   // URI
   if (NS_SUCCEEDED(aQuery->GetHasUri(&hasIt)) && hasIt) {
-    clause.Condition("h.url =").Param(":uri");
+    clause.Condition("h.url_hash = hash(").Param(":uri").Str(")")
+          .Condition("h.url =").Param(":uri");
   }
 
   // annotation
   aQuery->GetHasAnnotation(&hasIt);
   if (hasIt) {
     clause.Condition("");
     if (aQuery->AnnotationIsNot())
       clause.Str("NOT");