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