Closed Bug 826476 Opened 10 years ago Closed 10 years ago

Modify sqlite database pragmas to possibly improve performance


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

15 Branch
Not set


(Not tracked)

Firefox 22


(Reporter: mfinkle, Assigned: mfinkle)



(1 file, 1 obsolete file)

Attached patch WIP (obsolete) — Splinter Review
We currently use our subclass of SQLiteOpenHelper.onOpen to tweak some sqlite pragmas, originally done in bug 721320.

Some notes:
1. We treat the "PRAGMA synchronous" as mutually exclusive with support for enableWriteAheadLogging, but sqlite doesn't. We should always set "PRAGMA synchronous". Desktop Firefox also does this.
2. tabs.db is not a long-lived durable DB. We refresh the entire DB every time we update it. I think we can get away with less safety and get better performance. The patch uses "PRAGMA synchronous=OFF" and "PRAGMA read_uncommitted=true" to get better performance.

I think we should consider using "PRAGMA read_uncommitted=true" for browser.db too, but we need some testing first.

PRAGMA details here:

Note: For the Gecko sqlite usage, we use "PRAGMA synchronous=OFF" for all DB access:
Attachment #697662 - Flags: feedback?(bugmail.mozilla)
Comment on attachment 697662 [details] [diff] [review]

Review of attachment 697662 [details] [diff] [review]:

I don't see any problems with this, but wondering why you set the read_uncommitted pragma to true. Do you expect that to be significantly faster?
Attachment #697662 - Flags: feedback?(bugmail.mozilla) → feedback+
Attached patch patchSplinter Review
I'm ready to try this on Nightly. I removed the "read_uncommitted" pragma. I expected some improvement from this, but the Tabs DB is too small to see much difference. No sense in adding it.
Assignee: nobody → mark.finkle
Attachment #697662 - Attachment is obsolete: true
Attachment #699801 - Flags: review?(bugmail.mozilla)
Comment on attachment 699801 [details] [diff] [review]

Review of attachment 699801 [details] [diff] [review]:

Do we have appropriate telemetry in place to track if this helps?
Attachment #699801 - Flags: review?(bugmail.mozilla) → review+
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.