CREATE INDEX objectcustomfieldvalues1 ON objectcustomfieldvalues USING btree (customfield, objecttype, objectid, content); CREATE INDEX objectcustomfieldvalues2 ON objectcustomfieldvalues USING btree (customfield, objecttype, objectid);

The second index is redundant to the first. Depending on how the indexes are used (ie, all columns, or just some subset), if you reorder the columns, you can make the third index on this table redundant too.

Similarly, your attachments1 index is redundant to attachments3. Also depending on how tickets1 index gets used swapping the order and removing tickets4 may be more efficient overall, as well.

In general, if you're index columns list is a prefix of another index's, then it is a redundant index. This does not necessarily hold true for UNIQUE indexes, but often they are good enough even then. Ie, if the difference is within a percentage or two of time used, then you benefit over time by having one fewer index to update on row changes/inserts.

_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch today. Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com

Reply via email to