Permalink
Browse files

Backout 6831521f03ac to fix Bug 446621 - Slowdown on AutoComplete - A…

…wesomeBar. a=beltzner
  • Loading branch information...
1 parent e32ac96 commit 5920dfe5d5b1446a26eea424a5abcfd8461cd4b6 Edward Lee committed Jul 22, 2008
Showing with 10 additions and 4 deletions.
  1. +10 −4 toolkit/components/places/src/nsNavHistoryAutoComplete.cpp
@@ -259,9 +259,15 @@ nsNavHistory::CreateAutoCompleteQueries()
"FROM moz_places h "
"LEFT OUTER JOIN moz_favicons f ON f.id = h.favicon_id "
"WHERE h.frecency <> 0 ");
+ // NOTE:
+ // after migration or clear all private data, we might end up with
+ // a lot of places with frecency < 0 (until idle)
+ //
+ // XXX bug 412736
+ // in the case of a frecency tie, break it with h.typed and h.visit_count
+ // which is better than nothing. but this is slow, so not doing it yet.
nsCString sqlTail = NS_LITERAL_CSTRING(
- "ORDER BY h.frecency DESC, h.typed DESC, h.visit_count DESC "
- "LIMIT ?2 OFFSET ?3");
+ "ORDER BY h.frecency DESC LIMIT ?2 OFFSET ?3");
nsresult rv = mDBConn->CreateStatement(sqlHead + (mAutoCompleteOnlyTyped ?
NS_LITERAL_CSTRING("AND h.typed = 1 ") : EmptyCString()) + sqlTail,
@@ -292,7 +298,7 @@ nsNavHistory::CreateAutoCompleteQueries()
"JOIN moz_places h ON h.id = i.place_id "
"LEFT OUTER JOIN moz_favicons f ON f.id = h.favicon_id "
"GROUP BY i.place_id HAVING rank > 0 "
- "ORDER BY rank DESC, h.frecency DESC, h.typed DESC, h.visit_count DESC");
+ "ORDER BY rank DESC, h.frecency DESC");
rv = mDBConn->CreateStatement(sql, getter_AddRefs(mDBAdaptiveQuery));
NS_ENSURE_SUCCESS(rv, rv);
@@ -536,7 +542,7 @@ nsNavHistory::StartSearch(const nsAString & aSearchString,
}
sql += NS_LITERAL_CSTRING(") "
- "ORDER BY h.frecency DESC, h.typed DESC, h.visit_count DESC");
+ "ORDER BY h.frecency DESC");
rv = mDBConn->CreateStatement(sql, getter_AddRefs(mDBPreviousQuery));
NS_ENSURE_SUCCESS(rv, rv);

0 comments on commit 5920dfe

Please sign in to comment.