[rt-users] Re: Slow Query

Joop van de Wege JoopvandeWege at mococo.nl
Fri Aug 24 13:56:55 EDT 2007


Asif Iqbal wrote:
> I am reposting in case anyone missed my previous post
> 
> On 8/17/07, Asif Iqbal <vadud3 at gmail.com> wrote:
>> I have few queries that are extremely slow. I am using RT 3.4.5, Perl
>> 5.8.6, Solaris 10 x86, Apache/1.3.33 (Unix) mod_perl/1.29
>> mod_ssl/2.8.22 OpenSSL/0.9.7g, mysql 4.0.24, DBIx::SearchBuilder 1.40.
>> Is there any tweak to fix the slow querry?
>>
>> Slow Query Logs:
>>
>> # Query_time: 558  Lock_time: 0  Rows_sent: 0  Rows_examined: 2442535
>> SELECT COUNT(DISTINCT main.id) FROM Tickets main , Transactions
>> Transactions_1, Attachments Attachments_2  WHERE ((Transactions_1.O
>> bjectType = 'RT::Ticket')) AND ((main.EffectiveId = main.id)) AND
>> ((main.Status != 'deleted')) AND ((main.Type = 'ticket')) AND ( (
>>  (Attachments_2.Content LIKE
>> '%txcomber%')AND(Attachments_2.TransactionId =
This is your culprit and can't do nothing about it.
You're asking your DB engine to search through all your 
ticketbodies/attachments WITHOUT using an index and without realising 
this is a huge text column and therefor needs something special, like 
OracleText or PgText.

>> Transactions_1.id)AND(main.id = Transactions_1.ObjectId
>> ) ) );
		
Joop



More information about the rt-users mailing list