Closed Bug 1137462 Opened 10 years ago Closed 10 years ago

Improve history database performance

Categories

(Firefox for iOS :: Data Storage, defect)

All
iOS 8
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fxios + ---

People

(Reporter: wesj, Unassigned)

References

Details

Attachments

(1 file)

47 bytes, text/x-github-pull-request
st3fan
: review+
Details | Review
I haven't spent a lot of time working on performance of history access, but I think we can do a little better: 1.) Inserts into the visits currently have to do a separate lookup in the history table for the site id. We can do that in one command. Some perf testing on desktop shows about a 25% boost (i.e. 1.5 vs 2s to insert 10,000 entries). Seems like an easy win. 2.) Improve the date sorting. We current do our sectioning in the history view by iterating through all the data and looking at dates. There's no reason we can't just do 4 separate queries for it though (it also makes the code a lot cleaner). There's probably overhead to repeating the query 4 times, but it shows about an order of magnitude perf difference for me.
Attached file Pull request
This implements the fixes. I also did some other random cleanup as I went through here (like showing urls' when we don't have titles).
Attachment #8570144 - Flags: review?(sarentz)
Attachment #8570144 - Flags: review?(rnewman)
Comment on attachment 8570144 [details] [review] Pull request Added some small comments in the PR. My main concern is that there is too much hardcoded.
Attachment #8570144 - Flags: review?(sarentz) → review+
Assignee: nobody → wjohnston
Component: General → Data Storage
OS: Mac OS X → iOS 8
Hardware: x86 → All
Nick mentioned he was taking this over. See some notes and query plan analysis in <https://etherpad.mozilla.org/rnewman-history-sql>.
Assignee: wjohnston → nalexander
Status: NEW → ASSIGNED
Blocks: 1147615
Attachment #8570144 - Flags: review?(rnewman)
Did this land?
Depends on: 1163274
Blocks: 1169322
tracking-fennec: --- → ?
tracking-fennec: ? → +
tracking-fxios: --- → +
Assignee: nalexander → nobody
Status: ASSIGNED → NEW
tracking-fennec: + → ---
Well?
The first suggestion in the initial comment here is already implemented. The second isn't really needed (we've revamped the in-memory partitioning a few times). I'm closing this as Fixed. We can open a meta somewhere to track general perf improvements, (but I think we have that already somewhere...)
Status: NEW → RESOLVED
Closed: 10 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: