[rt-devel] Slow Queries part3, Groups

Ruslan U. Zakirov cubic at acronis.ru
Fri Oct 10 12:42:30 EDT 2003


Robert Spier wrote:
>>I'm not best of best in DBs, but I want draw your attention to table 
>>Principals and where clauses of this select.
>>First of all, we use only id from this table.
>>Second, in accordance with RT::Group->PrincipalObj
> 
> 
> I don't believe the Principal's stuff is the slow part of this query.
> (At least not from my analysis of the EXPLAIN output.)  I know the
> Principal stuff is there for a reason, I believe it has to do with
> delegation of rights, but Jesse can explain that better.
Ugh.
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.

Open your eyes and look at the query logic and not on how it's fast or no.
	
	Best regards and nothing personal. Ruslan.
> 
> 
>>And at last, query MUST be:
>>SELECT DISTINCT main.*
> 
> 
> What did I screw up?
> 
> -R





More information about the Rt-devel mailing list