Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InnoDB Auto-Increment on secondary key column?

Status
Not open for further replies.

MrMoke

MIS
Aug 29, 2002
12
US
MySQL MyISAM keys that use an auto-increment attribute as the secondary part of a multi-column key, allow the generated value to be tightly associated with the primary part of the key, while the auto-increment in InnoDB is just a running number. This forces you to use an attribute for the auto-increment attribute that can accomodate the maximum table size even though a single grouping may never exceed ten. Depending the order of entry the comparison might be

MyISAM:
dog/1
dog/2
cat/1
cat/2
fish/1
fish/2
fish/3

InnoDB:
dog/4
dog/5
cat/1
cat/3
fish/2
fish/6
fish/7

While it does accomplish a natural grouping, it also forces inefficient usage of storage, since you have to accomodate the largest table size. Is there any way around it?

Facing Future - IZ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top