Closed Bug 1277329 Opened 8 years ago Closed 3 years ago

Consider dropping History.VISITS aggregate count

Categories

(Firefox for Android Graveyard :: Data Providers, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: Grisha, Unassigned)

Details

Now that we're keeping track of History.LOCAL_VISITS and History.REMOTE_VISITS (see Bug 1274029), we should consider either dropping History.VISITS entirely, or making it a sum of LOCAL_VISITS and REMOTE_VISITS which is calculated in the Combined view, as opposed to maintaining it manually ourselves.

We used to use it for generating approximate frecency values, but we don't anymore (see 1265525).

Consider: what else do we use VISITS count for? If it's a sum of the other two counts, how does this affect Sync, if at all?
Similarly, consider cleaning up History.DATE_LAST_VISITED;
If we don't use it, remove it. Even if we do, consider removing it and explicitly using counts -- right now it's probably buggy! -- or introducing a materialized view if the counts are expensive to compute.
Assignee: nobody → dlim
Given the current state of affairs, here is what I think is a sane approach:
- add a new view, "history_with_aggregates", which is all of History columns with an addition of VISITS=LOCAL_VISITS+REMOTE_VISITS and DATE_LAST_VISITED=MAX(LOCAL_DATE,REMOTE_DATE).
- update BrowserProvider's history querying to use your new view
- update view_history_with_favicons to use your new view
-- at this point, everything should work as before
- clean up any code which tries to manually manage History.VISITS and History.DATE_LAST_VISITED. You will need to touch BrowserProvider, LocalBrowserDB, AndroidBrowserHistoryDataAccessor, etc.
- tests!
- finally, drop both of these fields from the History table
Assignee: dlim → nobody
Priority: -- → P3
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.