Closed
Bug 718224
Opened 14 years ago
Closed 14 years ago
Very bad query in /reports/index
Categories
(Socorro :: Webapp, task)
Tracking
(Not tracked)
VERIFIED
FIXED
2.4.3
People
(Reporter: jberkus, Assigned: laura)
Details
the /reports/index page hits the database with at least one really poorly written query which is causing unneccessary database load:
/* soc.web report.dateProcessed */
SELECT reports.email, reports.url, reports.addons_checked,
( SELECT reports_duplicates.duplicate_of FROM reports_duplicates WHERE reports_duplicates.uuid = reports.uuid) as duplicate_of
FROM reports
WHERE reports.uuid='eb792bab-6c3b-46a7-b339-e7d882120113'
AND reports.success
IS NOT NULL
",,,,,,,,,""
That's problematic because it doesn't contain any date range for date_processed, so it's going to hit all 60+ partitions for the 200GB reports table.
| Reporter | ||
Updated•14 years ago
|
Target Milestone: --- → 2.4.2
| Assignee | ||
Updated•14 years ago
|
Assignee: nobody → laura
| Assignee | ||
Comment 1•14 years ago
|
||
Josh: This surprises me - it's only pulling a single report by uuid (WHERE reports.uuid=?) so I would have assumed it went from index to the correct partition. If that's not in fact the case I guess we can guess at the date range from the uuid and limit it that way. Does that work for you?
| Reporter | ||
Comment 2•14 years ago
|
||
Our partitioning schedme doesn't include any filtering on the UUID per partition, so the database has no way of knowing that that UUID can be found in only one partition. We could add some, I suppose ... the last 6 digits of the UUID are the date, no?
| Assignee | ||
Comment 3•14 years ago
|
||
That's what I was thinking too. Could add some app logic using the date from the UUID to put a date rnage in the SQL.
| Assignee | ||
Comment 4•14 years ago
|
||
jberkus, r?: https://github.com/mozilla/socorro/pull/342
Target Milestone: 2.4.2 → 2.4.3
Comment 5•14 years ago
|
||
Commits pushed to master at https://github.com/mozilla/socorro
https://github.com/mozilla/socorro/commit/41c719d6d811bba273283fbce05a52f7c0e9ca2e
Fixes bug 718224, limit query by date to improve performance by only
searching a single partition of the reports table
https://github.com/mozilla/socorro/commit/383c651e26332c1befc6ab305e1449587ef18943
Merge pull request #342 from lauraxt/718224
Fixes bug 718224, limit query by date to improve performance by only searching a single partition of the reports table
Updated•14 years ago
|
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 6•14 years ago
|
||
Which page(s)/URL(s) would this have affected?
Comment 7•14 years ago
|
||
What are the steps to verify?
| Assignee | ||
Comment 8•14 years ago
|
||
This comes up on any individual crash report page. It should work the same as before, only faster.
Picking one at random, e.g.
https://crash-stats.allizom.org/report/index/497678d5-88e0-4b14-b681-575332120216
Comment 9•14 years ago
|
||
Bumping to QA verified on stage .. I'm not sure how to quantify that individual reports are loading faster however I can verify that individual reports continue to load expected (comment 8).
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•