Closed
Bug 782803
Opened 13 years ago
Closed 7 years ago
Reduce SQL queries needed by Kuma wiki feeds
Categories
(developer.mozilla.org Graveyard :: Editing, defect, P3)
developer.mozilla.org Graveyard
Editing
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: lorchard, Unassigned)
References
Details
Currently, the feeds for Documents and Revisions in Kuma perform 3 SQL queries for each item in the feed. So, if a feed has a limit of 100 items, this fires off 300 DB queries.
It looks like this can be reduced by using prefetch_related() [1] to build a proper JOIN query, but that requires a Django 1.4 upgrade. This could probably be fixed by just using raw SQL, but that feels painful.
[1] https://docs.djangoproject.com/en/1.4/ref/models/querysets/#prefetch-related
Reporter | ||
Comment 1•13 years ago
|
||
Oh, and the 3 queries are each to wiki_revision (for current_revision), auth_user (for authorship info), and wiki_documenttag (for categories). These could probably just all be rolled into the same request that fetches Documents.
An exception might be wiki_documenttag, at least not without some fancy raw SQL. We may want to refrain from including tag links in feeds, or hide them behind an option.
Reporter | ||
Updated•13 years ago
|
Component: Website → Docs Platform
Updated•13 years ago
|
Priority: -- → P3
Assignee | ||
Updated•13 years ago
|
Version: Kuma → unspecified
Assignee | ||
Updated•13 years ago
|
Component: Docs Platform → Editing
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
Updated•5 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•