[rt-users] RT 3.8.9 + PostgreSQL 8.4.7 - missing/bad indexes

Jesse Vincent jesse at bestpractical.com
Thu Apr 14 22:09:58 EDT 2011




On Thu 14.Apr'11 at 15:26:33 +0200, Václav Ovsík wrote:
> Hi,
> because of horrible performance of spreadsheet export of tickets I found
> some badly created or missing indexes. I didn't investigate if other
> RDBMS schemas has the same problem.
> To discover problems I rewrote Results.tsv into command-line shape and
> run it with DBI_TRACE=2 finally. 
> 
> For every row of Tickets the following additional problematic queries are
> executed:
> 
> ########################################################################
> 
> SELECT  * FROM Groups WHERE Instance = ? AND LOWER(Domain) = LOWER(?) AND LOWER(Type) = LOWER(?)
> 
> e.g. one my bind params: 106431 'RT::Ticket-Role' 'Requestor'
> 
> rt=# EXPLAIN ANALYZE SELECT * FROM Groups WHERE Instance = 106431 AND LOWER(Domain) = LOWER('RT::Ticket-Role') AND LOWER(Type) = LOWER('Requestor');
> 							     QUERY PLAN                                                              

I'd actually consider this a code bug. We shouldn't be LOWER()ing either 
of those parameters.  Please open a ticket by mailing
rt-bugs at bestpractical.com

Thanks!



More information about the rt-users mailing list