Closed
Bug 288973
Opened 20 years ago
Closed 20 years ago
Front page queries are sub-optimized
Categories
(addons.mozilla.org Graveyard :: Public Pages, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.0
People
(Reporter: ma1, Assigned: ma1)
References
()
Details
Attachments
(1 file, 1 obsolete file)
|
11.80 KB,
patch
|
morgamic
:
first-review+
|
Details | Diff | Splinter Review |
Front page is obviously the most hit one of the entire site, hence its SQL queries should be as optimized as possible. index.php contains 3 queries wich extract unneeded fields and rows, followed by PHP loops which emulate functionality easily achieved with sane SQL. Looking at http://lxr.mozilla.org/mozilla/source/webtools/update/index.php#141 http://lxr.mozilla.org/mozilla/source/webtools/update/index.php#182 and http://lxr.mozilla.org/mozilla/source/webtools/update/index.php#224 needed changes are easily spotted: 1. don't extract TV.* fields, since they are not used 2. put a DISTINCT clause (depending on step 1) 3. add a LIMIT 5 clause 4. eliminate all the PHP code which emulate the above SQL from the data consuming loops I'll post a patch as soon as bug #287159 (which work on the same code) is fixed.
| Assignee | ||
Comment 1•20 years ago
|
||
Also coalesces redundant calls to uriparams() and ucwords()
Attachment #179709 -
Flags: first-review?(mike.morgan)
| Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Comment 2•20 years ago
|
||
Comment on attachment 179709 [details] [diff] [review] fixes queries and loops Fix the two instances where a "$" was missing before uriparams -- then we can call it good.
Attachment #179709 -
Flags: first-review?(mike.morgan) → first-review-
| Assignee | ||
Comment 3•20 years ago
|
||
Attachment #179709 -
Attachment is obsolete: true
Attachment #179830 -
Flags: first-review?(mike.morgan)
Comment 4•20 years ago
|
||
Comment on attachment 179830 [details] [diff] [review] Fixed as morgamic said Sometime later we can examine why uriparams is there at all. Until we have time for that, this is a good improvement. Thanks for fixing those two lines.
Attachment #179830 -
Flags: first-review?(mike.morgan) → first-review+
Comment 5•20 years ago
|
||
This has been committed. Thanks, Mao.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•