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

Václav Ovsík vaclav.ovsik at i.cz
Fri Apr 15 05:07:38 EDT 2011


On Fri, Apr 15, 2011 at 12:09:58PM +1000, Jesse Vincent wrote:
> ...
> 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

I did it. It have received ticket [rt3 #17121].

About the second problem - selecting from ObjectCustomFieldValues - I'm
not certain the adding a new index is the best solution.
I have red about multicolumn indexes in Pg docs yesterday and found for
me, that multicolumn indexes can be used for lower number of fields, but
these must be the leftmost fields. So we have already:

CREATE INDEX ObjectCustomFieldValues1 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId,Content); 
CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId); 

So instead of adding a new index I did
CREATE INDEX ObjectCustomFieldValues_zito1 ON ObjectCustomFieldValues (ObjectId);
alternative approach can be to reorder index columns of ObjectCustomFieldValues2?
It depends on a shape of every other query on ObjectCustomFieldValues and
decision can be difficult (analyze of all possible query shapes).

Should I send it to rt-bugs also?

Best Regards
-- 
Zito



More information about the rt-users mailing list