Bug 437912 - FlagList() really slow when included in a column for query results
Summary: FlagList() really slow when included in a column for query results
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Database
Version: 3.2
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tony Fu
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: RHBZ30UpgradeTracker
TreeView+ depends on / blocked
 
Reported: 2008-03-18 04:17 UTC by David Lawrence
Modified: 2008-05-28 03:49 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-28 03:49:09 UTC
Embargoed:


Attachments (Terms of Use)
Patch to speed up FlagList() stored function some (v1) (4.08 KB, patch)
2008-03-24 21:55 UTC, David Lawrence
dkl: review? (tfu)
Details | Diff
Patch to speed up FlagList() stored function some (v2) (4.39 KB, patch)
2008-03-26 03:33 UTC, David Lawrence
tfu: review+
Details | Diff

Description David Lawrence 2008-03-18 04:17:40 UTC
Description of problem:
Due to recent changes in the stored function FlagList(), it has become slow to
return results when including the column in buglist.cgi. The changes were due to
the flags.is_active columns no longer present in 3.2 schema. Need to determine
where the performance hit is coming from in the stored function code.

rh_bugzilla_3:
redhat/bugs-functions.mysql

Comment 1 David Lawrence 2008-03-24 21:55:37 UTC
Created attachment 298957 [details]
Patch to speed up FlagList() stored function some (v1)

This simplification seems somewhat faster to me than what is there currently. I
am passing in only the bug id and user id to the function. The function is then
looking up the group_ids for the user in a sub select instead of creating a
temporary table. 

Alot of the slowdown with the current implementation seems to be coming from
blocking while trying to create the tmpGroupIds temp table. Alleviating that
need seems to speed it up some although it is not as fast as it could be.

Tony please have a look at the change and let me know what you think.

Dave

Comment 2 David Lawrence 2008-03-26 03:33:40 UTC
Created attachment 299092 [details]
Patch to speed up FlagList() stored function some (v2)

Updated patch. Enabled inclusion of attachment flags in the flag list if the
flagged attachment is either not private or the user is in the insider group
which allows them to see the attachment.

Tony, please take a look. I have this change running on
https://bugdev.devel.redhat.com/bugzilla if you want to try it out against the
snapshot database.

Thanks

Comment 3 Tony Fu 2008-05-02 06:20:07 UTC
Dave,

This new sql fucntion looks good.  I have tested it against a test database and
it works fine.

By the way, I don't have a sudo permission to access bz-web1-test.devel.  Can
you set set it up for me please?


Thanks,
Tony

Comment 4 David Lawrence 2008-05-02 14:48:41 UTC
Thanks Tony. Changing to MODIFIED.


Note You need to log in before you can comment on or make changes to this bug.