A month or two back I posted a question asking if an AutoIncrement
column in a multicolumn index was supposed to work. At the time, I had
accidently produced the intended effect, and couldn't duplicate it.
Today, while browsing the MySQL docs, I discovered how to do it
properly, and thought those who don't know how it works might want to
The key (no pun intended) to getting it to work is twofold.
First, the table type must be MyISAM or BDB.
Second, it will maintain a seperate autoincrement for every unique
/prefix/ or, in plain english, for every unique combination of values in
the columns that come /before/ the AutoIncrement column in the index.
Hope this helps someone. I know it's going to help me significantly.
|• Multi-Column Index with AutoIncrement||Matthew Walker||16 Aug|