Slow Queries part3, Groups

I talk not about perfomance issues. I talk about query itself. It’s
wrong and only one particular feature save RT from logic breakage of
results from this select. This feature is that that each row in
Principals table have ObjectId == id.
Groups.id (in our select main.id) referenced not by Principals.id, but
by Principals.ObjectId.

Principals.ObjectId is defined to always be Principals.Id. ALWAYS. The
fact that there’s an ObjectId is actually a slight historical accident.
Really, we should be moving to always use .id instead of .ObjectId

Request Tracker... So much more than a help desk — Best Practical Solutions – Trouble Ticketing. Free.

Anyone had any luck with this (I admin its dropped off my radar for a few
days, but its back now)?

Regards,
Matt Watson.

This is what I ended up doing. I’m hoping it doesn’t break anything,
I couldn’t see anything obvious broken.

Cheers for the suggestion.

btw… this cuts the page load time down to about .2 seconds.

Regards.
Matt Watson
Netspace Online Systems.

Could you make a patch of your changes? I’d be interested in seeing
them.

Thanks!

-R

At Thu, 16 Oct 2003 10:43:31 +0800,
Matthew Watson wrote:

sure thing…

Sorry if this isn’t the correct way for doing patches(had a quick look
through the archives,
looked ok), pretty new to doing that :slight_smile:

Find patch attached.

Regards.
Matthew Watson.
Netspace Online Systems.–On Wednesday, October 15, 2003 9:21 PM -0700 Robert Spier rspier@pobox.com wrote:

Could you make a patch of your changes? I’d be interested in seeing
them.

Thanks!

-R

At Thu, 16 Oct 2003 10:43:31 +0800,
Matthew Watson wrote:

This is what I ended up doing. I’m hoping it doesn’t break anything,
I couldn’t see anything obvious broken.

Cheers for the suggestion.

btw… this cuts the page load time down to about .2 seconds.

Regards.
Matt Watson
Netspace Online Systems.

Another solution, which might be cheating, is to add another argument
to WithRight – IncludeRoleRights, default to 1. (Going back to the
original reason here of building a list of possible owners) While
“Owner” implies certain rights, the list of possible owners comes from
the Queue, so there’s no reason to even perform the Role search
(second half above). You then test for IncludeRoleRights on the line
( if ( defined $args{‘Object’} ) { ) that guards the building of the
RoleRight part of the query.

A little wave of the magic wand, and simple searches run faster. tada!

-R

IncludeRoleRights.diff (3.89 KB)