From: Jeremy Chase Date: January 30 2013 7:25pm Subject: InnoDB interaction between secondary and primary keys. List-Archive: http://lists.mysql.com/mysql/228891 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d043893bdbad7fe04d4867855 --f46d043893bdbad7fe04d4867855 Content-Type: text/plain; charset=UTF-8 Hello, I've been working with a secondary index and would like some clarification about how the primary columns are included. So, in the following example, is the secondaryKey effectively the same as redundantKey? CREATE TABLE `example` ( `1` int(10) unsigned NOT NULL, `2` int(10) unsigned NOT NULL, `3` int(10) unsigned NOT NULL, `4` int(10) unsigned NOT NULL, PRIMARY KEY (`1`,`2`), KEY `secondaryKey` (`3`, `4`) KEY `redundantKey` (`3`, `4`, `1`, `2`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 Background: http://dev.mysql.com/doc/refman/5.5/en/innodb-index-types.html "In InnoDB, each record in a secondary index contains the primary key columns for the row, as well as the columns specified for the secondary index." Thank you! Jeremy --f46d043893bdbad7fe04d4867855--