Closed
Bug 468461
Opened 16 years ago
Closed 14 years ago
Add an index to type column for tiki_comments
Categories
(support.mozilla.org :: Forum, task)
support.mozilla.org
Forum
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
Future
People
(Reporter: cww, Assigned: cww)
References
Details
Attachments
(1 file, 1 obsolete file)
Right now, searching for solved or "proposed solved" problems is killing my computer. An index on the `type` column should help. Although I could also be doing it wrong.
If this is any incentive, this will really really help performance of queries done with the forum filtered per bug 444331 And double incentive: here's the one-line SQL QUERY that will fix this bug ALTER TABLE mozdump.tiki_comments ADD INDEX type(`type`); (Of course, feel free to add more stuff if you think it's necessary)
CCing Laura. This shouldn't require a push even so can it be done off schedule?
Comment 3•16 years ago
|
||
(In reply to comment #0) > Right now, searching for solved or "proposed solved" problems is killing my > computer. An index on the `type` column should help. > > Although I could also be doing it wrong. What do your queries look like?
When doing a full count of how many threads are each type: SELECT type, COUNT(1) FROM `tiki_comments` tc WHERE tc.object = 1 and tc.objectType = 'forum' and tc.parentId = 0 and FROM_UNIXTIME(commentDate) BETWEEN CAST('2008-12-02' AS Date) AND CAST('2008-12-09' AS Date) GROUP BY type; Or even when I'm just pulling up a list of threads: SELECT DISTINCT IF(parentId = 0, threadId, parentId) AS 'threads' FROM tiki_comments WHERE type = 'r' AND `object`=1 AND `objectType` = 'forum' ORDER BY `commentDate` DESC LIMIT 20 (This pulls up the thread numbers of the last 20 commented-on threads which are marked request for more info... I do a secondary query on these to get the actual contents of the threads). I've found it actually works faster to just build an index using ALTER TABLE ADD INDEX when I import the database since the time savings is made up for after just a couple queries. This takes 15 minutes (during which computer is unusable) though and is clobbered every time I import again (at least once a week, sometimes twice). It'd be nice just to have it there already.
Updated•15 years ago
|
Assignee: nobody → cwwmozilla
Target Milestone: --- → Future
Made a patch so I can get review.
Attachment #384022 -
Flags: review?(laura)
Comment 6•15 years ago
|
||
Cheng, perhaps we should add any not-currently-existing indexes from bug 498105 as well.
Comment 7•15 years ago
|
||
I would suggest not conflating the patches. If you need those indexes make this bug dependent on that one.
Updated•15 years ago
|
Attachment #384022 -
Attachment mime type: application/octet-stream → text/plain
Updated•15 years ago
|
Attachment #384022 -
Flags: review?(laura) → review+
From bug 498105 comment 7: we don't actually need new indexes in addition the this one for bug 498105. This patch should stand as is.
This patch is really low risk, can we just take it?
Target Milestone: Future → 1.3
Assignee | ||
Comment 10•15 years ago
|
||
(btw, this is just SQL, so should I just file a bug to have it run on staging and resolve this fixed?)
Assignee | ||
Comment 11•15 years ago
|
||
took out DB name since that's not the same on all installs
Attachment #384022 -
Attachment is obsolete: true
Attachment #393023 -
Flags: review?(laura)
Updated•15 years ago
|
Attachment #393023 -
Attachment mime type: application/octet-stream → text/plain
Updated•15 years ago
|
Attachment #393023 -
Flags: review?(laura) → review+
Comment 12•15 years ago
|
||
Could we get some benchmarks as well?
Updated•15 years ago
|
Target Milestone: 1.3 → 1.5
Assignee | ||
Comment 13•15 years ago
|
||
I couldn't tell on sumotools so I guess we don't need to do this. (It seems like a good idea though.
Updated•15 years ago
|
Target Milestone: 1.5 → Future
Updated•14 years ago
|
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•