Closed
Bug 428300
Opened 17 years ago
Closed 17 years ago
status page is slow
Categories
(Socorro :: General, task)
Socorro
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ted, Assigned: ted)
References
()
Details
Attachments
(1 file, 1 obsolete file)
|
2.16 KB,
patch
|
Details | Diff | Splinter Review |
Why is the status page so slow? It's doing two queries, one or both of them must suck. I would guess it's the reports query, since that table is much bigger.
| Assignee | ||
Comment 1•17 years ago
|
||
select([reports.c.date_processed],
order_by=sql.desc(reports.c.date_processed),
limit=1
is the reports query.
select([func.count(jobs.c.id)],
jobs.c.completeddatetime == None
is the jobs query. is that reports query screwing us by not having a date limit? I would think 'limit 1' would be good.
| Assignee | ||
Comment 2•17 years ago
|
||
explain select date_processed from reports order by date_processed desc limit 1;
Limit (cost=2655.91..2655.91 rows=1 width=8)
-> Sort (cost=2655.91..2667.54 rows=4652 width=8)
Sort Key: public.reports.date_processed
-> Result (cost=0.00..2372.52 rows=4652 width=8)
-> Append (cost=0.00..2372.52 rows=4652 width=8)
-> Seq Scan on reports (cost=0.00..10.20 rows=20 width=8)
-> Seq Scan on reports_part1 reports (cost=0.00..2362.32 rows=4632 width=8)
Yeah, that's bad. We don't have an index on date_procesed. Can we just get this from the jobs table instead? Or store it somewhere else?
| Assignee | ||
Comment 3•17 years ago
|
||
This is approximately a million billion times better. Ok, it's still doing a seq scan on jobs, but that table is much smaller than reports. We could toss an index on here to make it better, but that's of questionable merit. Adding an index to reports to fix this problem just seems silly.
Assignee: nobody → ted.mielczarek
Status: NEW → ASSIGNED
Attachment #314843 -
Flags: review?(morgamic)
Comment 4•17 years ago
|
||
Comment on attachment 314843 [details] [diff] [review]
use jobs instead
Could we add # of items in the queue, # of threads and oldest item in queue?
Attachment #314843 -
Flags: review?(morgamic) → review+
| Assignee | ||
Comment 5•17 years ago
|
||
# items in queue is already on that page. I'll make it grab the other info.
| Assignee | ||
Comment 6•17 years ago
|
||
Yeah, I didn't add # of processors because we don't have that table defined yet in the SQLAlchemy model, and I just don't feel like adding it. This adds OldestQueuedJob, AverageProcessTime (process end time - process start time), and AverageWaitTime (process end time - queue time).
Attachment #314843 -
Attachment is obsolete: true
| Assignee | ||
Updated•17 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Component: Socorro → General
Product: Webtools → Socorro
You need to log in
before you can comment on or make changes to this bug.
Description
•