Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Closes #169: Process fewer history results in javascript to reduce me…
Browse files Browse the repository at this point in the history
…mory usage

Call AUTOCOMPLETE_MATCH with the title and url and dummy other values to match on boundary.
  • Loading branch information
Mardak committed Mar 8, 2011
1 parent 4a3e9c7 commit 67166dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions homeDash/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,7 @@ function addDashboard(window) {
history.allPagesByFrecency = Svc.History.DBConnection.createAsyncStatement(
"SELECT title, url " +
"FROM moz_places " +
"WHERE AUTOCOMPLETE_MATCH(:query, url, title, '', 0, 0, 0, 0, 2, 0) " +
"ORDER BY frecency DESC " +
"LIMIT :offset, " + PAGES_PER_CHUNK);

Expand Down Expand Up @@ -1708,6 +1709,7 @@ function addDashboard(window) {
history.searchPlaces = function(offset) {
let statement = history.allPagesByFrecency;
statement.params.offset = offset;
statement.params.query = history.lastQuery;

// Filter out history results based on the current query
let thisSearch = history.activeSearch = statement.executeAsync({
Expand Down

0 comments on commit 67166dd

Please sign in to comment.