Bug 437912 - FlagList() really slow when included in a column for query results
FlagList() really slow when included in a column for query results
Product: Bugzilla
Classification: Community
Component: Database (Show other bugs)
All Linux
low Severity low (vote)
: ---
: ---
Assigned To: Tony Fu
Depends On:
Blocks: RHBZ30UpgradeTracker
  Show dependency treegraph
Reported: 2008-03-18 00:17 EDT by David Lawrence
Modified: 2008-05-27 23:49 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-27 23:49:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description David Lawrence 2008-03-18 00:17:40 EDT
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.

Comment 1 David Lawrence 2008-03-24 17:55:37 EDT
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.

Comment 2 David Lawrence 2008-03-25 23:33:40 EDT
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.

Comment 3 Tony Fu 2008-05-02 02:20:07 EDT

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?

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

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