Closed Bug 1131737 Opened 9 years ago Closed 6 years ago

Expire history and favicons

Categories

(Firefox for iOS :: Data Storage, defect, P1)

All
iOS
defect

Tracking

()

RESOLVED FIXED
Tracking Status
fxios 13.0 ---

People

(Reporter: wesj, Assigned: justindarc)

References

Details

Attachments

(1 file)

Right now we download and store a lot of history and favicon data. We need an expiry for it as well probably.
Blocks: 1126992
Blocks: iosfavicons
Blocks: 1128609
OS: Mac OS X → iOS
Hardware: x86 → All
I ran an approximation of our history search implementation on my current iPad data.

Wiping the two favicons tables knocked 25% off our runtime.

Expiring old visits:

   DELETE FROM visits ORDER BY date ASC LIMIT 100000;

didn't make much difference.

Killing 150,000 old history items did:

   DELETE FROM history WHERE NOT EXISTS (SELECT 1 FROM visits WHERE visits.siteID = history.id);

That's because the query plan begins by searching for matching text, which is a table scan, which is linear over the amount of stored history. We need Bug 1173164.
Requesting tracking: search on my iPad takes up to nine seconds to show results.
tracking-fxios: --- → ?
Priority: -- → P2
Priority: P2 → P3
Priority: P3 → P2
Richard, can you let me know if the FTS search in the latest v13 Beta helps with your abundant history?
Flags: needinfo?(bugzilla)
Text search performance is much better, yes.

That doesn't entirely obsolete this bug — there are still space and performance reasons to expire old content — but now we can be less destructive, perhaps putting the limit at 100K places or a certain file size.
Flags: needinfo?(bugzilla)
(In reply to Richard Newman [:rnewman] from comment #5)
> Text search performance is much better, yes.
> 
> That doesn't entirely obsolete this bug — there are still space and
> performance reasons to expire old content — but now we can be less
> destructive, perhaps putting the limit at 100K places or a certain file size.

Awesome! Thanks for checking!

Last question: How often do you think we should run our cleanup process? Surely, we don't want to check on each launch. Every 30 days?
(In reply to Justin D'Arcangelo [:justindarc] from comment #6)

> Awesome! Thanks for checking!
> 
> Last question: How often do you think we should run our cleanup process?
> Surely, we don't want to check on each launch. Every 30 days?

Consider that it's mostly Sync that will cause an issue here, and consider that what you really want to do is try to clean up when certain conditions are met and performance is suffering.

It's cheap to examine the size of browser.db, very cheap to measure how long a query took to run, and relatively cheap to measure how many rows are in the history table via `SELECT COUNT(rowid) FROM history`.

I would probably hook this into the rebuild of the top sites cache, or trigger a one-time-per-launch run if a history query is particularly slow. You should collect telemetry before you make a decision.
Assignee: nobody → jdarcangelo
Status: NEW → ASSIGNED
Priority: P2 → P1
Attached file GitHub Pull Request
Attachment #8994322 - Flags: review?(fpatel)
Comment on attachment 8994322 [details] [review]
GitHub Pull Request

Carrying over R+ from GitHub.
Attachment #8994322 - Flags: review?(fpatel) → review+
Landed on master:

https://github.com/mozilla-mobile/firefox-ios/commit/e613114ec6c625fa791811e4700d782e49951d10
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: