----- Original Message ---- From: Robert DiFalco <[EMAIL PROTECTED]> To: mysql@lists.mysql.com Sent: Thursday, March 9, 2006 9:32:44 AM Subject: InnoDB Indices
I have some questions regarding InnoDB indices. Say I have a table with millions of records. On of the fields is a type field that has a possible value of 1,2,3, or 4. I sometimes query by the type field and may at other times order on it. Do queries benefit from an index with this low of a selectivity? ++ For the most part no. I come from Oracle where you can use histograms to help. So, someone feel free to correct me if I'm wrong. If through the query browser I find that they do, should I increase the selectivity of the index by making it a compound index and adding my Primary Key to the TYPE index? ++ If your primary key will be included in the where clause then definitely include it. If I make it a compound index, does it have any positive impact on INSERT, UPDATE, or maybe just DELETE? ++ I can't see it helping with insert, but depending on the where clause on your updates and deletes it could. Dave R. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]