Closed Bug 403375 Opened 17 years ago Closed 17 years ago

content pref database does full table scan for most common query

Categories

(Firefox :: Settings UI, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Firefox 3 beta3

People

(Reporter: myk, Assigned: myk)

References

(Depends on 1 open bug)

Details

(Keywords: perf)

Attachments

(2 files)

The content pref database does a full table scan of the prefs table when the content pref service executes its most common query: retrieving the value of a single pref for some site.

This can be avoided with the judicious use of indices, specifically indices on the name columns in the groups and settings tables and an index across both groupID and settingID in the prefs table.

Here's a patch that adds those indices.

Note: this performance issue won't show up in our existing automated tests because those use fresh profiles with empty databases for which a full table scan looks just as fast as an index-based lookup.  But this patch will make a difference as users accumulate site-specific preference data.
Attachment #288190 - Flags: review?(mconnor)
Requesting wanted-firefox3 on this performance improvement for site-specific preferences.
Flags: blocking-firefox3?
Priority: -- → P3
Flags: blocking-firefox3? → blocking-firefox3+
Comment on attachment 288190 [details] [diff] [review]
patch v1: adds indices

Looks good, sorry for the delay here.
Attachment #288190 - Flags: review?(mconnor) → review+
Here's a version of the patch that has been updated to fix minor conflicts from the checkin for bug 385224.  This is the version of the patch I'll check in.
Checking in toolkit/components/contentprefs/src/nsContentPrefService.js;
/cvsroot/mozilla/toolkit/components/contentprefs/src/nsContentPrefService.js,v  <--  nsContentPrefService.js
new revision: 1.12; previous revision: 1.11
done
Status: ASSIGNED → RESOLVED
Closed: 17 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: