Closed
Bug 713144
Opened 13 years ago
Closed 13 years ago
The SQL query to remove older searches from the profile_search table should be more robust
Categories
(Bugzilla :: Query/Bug List, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.2
People
(Reporter: LpSolit, Assigned: LpSolit)
Details
(Keywords: perf)
Attachments
(1 file)
1.12 KB,
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
For some unknown reasons, it may happen that the profile_search table stores more than SAVE_NUM_SEARCHES (default 10) recent searches per user. For instance, bmo stores 5532 buglists for me, and 207422 for dsicore! This makes viewing a bug slower, because Bugzilla scans them all to see which buglist to use for the Prev/Next navigation links. We should improve the SQL query to really delete older queries.
Attachment #583958 -
Flags: review?(justdave)
![]() |
Assignee | |
Updated•13 years ago
|
Severity: normal → minor
Comment 1•13 years ago
|
||
For comparison, here's what I actually ran on the database server to clean out the overages:
# mysql --skip-column-names -B -e 'select concat("DELETE FROM profile_search WHERE user_id=", search_counts.user_id, " AND id <= ", (select id from profile_search where user_id=search_counts.user_id order by id desc limit 10,1), ";") from (select user_id, count(id) as num from profile_search group by user_id) as search_counts where num > 10;' bugs | mysql bugs
![]() |
Assignee | |
Comment 3•13 years ago
|
||
Comment on attachment 583958 [details] [diff] [review]
patch, v1
Asking glob too as I saw that justdave was away till Dec 27.
Attachment #583958 -
Flags: review?(glob)
![]() |
Assignee | |
Updated•13 years ago
|
Attachment #583958 -
Flags: review?(glob) → review?(dkl)
Comment 4•13 years ago
|
||
Comment on attachment 583958 [details] [diff] [review]
patch, v1
Review of attachment 583958 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good and works as expected. r=dkl
Attachment #583958 -
Flags: review?(dkl) → review+
![]() |
Assignee | |
Updated•13 years ago
|
Attachment #583958 -
Flags: review?(justdave)
![]() |
Assignee | |
Updated•13 years ago
|
Flags: approval4.2+
Flags: approval+
![]() |
Assignee | |
Comment 5•13 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Search/Recent.pm
Committed revision 8051.
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified Bugzilla/Search/Recent.pm
Committed revision 7987.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•