![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
We have an application in our company and we use 32 byte keys, generated from hibernate, being used as primary keys in our MySQL database. As these are the primary keys for MySQL, they also become the clustered index for the table for which they belong to. |
|
In resume: is there anyway to DISABLE MySQL from creating a clustered index and to make it order the records in the same order as they're inserted in the database? |
#3
| |||
| |||
|
|
raviaw <rav... (AT) gmail (DOT) com> wrote: We have an application in our company and we use 32 byte keys, generated from hibernate, being used as primary keys in our MySQL database. As these are the primary keys for MySQL, they also become the clustered index for the table for which they belong to. This is only true for InnoDB tables. In the following I assume that we are talking about InnoDB tables. In resume: is there anyway to DISABLE MySQL from creating a clustered index and to make it order the records in the same order as they're inserted in the database? You will get something along that if you do not specify a PRIMARY KEY in the table definition. Your former primary key becomes a UNIQUE KEY. With no primary key in the table definition, InnoDB will create a hidden primary key very similar to BIGINT UNSIGNED AUTO_INCREMENT and use it internally to identify rows. Rows will be clustered according to this hidden column and secondary indexes will refer to rows via that hidden column too. HTH, XL -- Axel Schwenke, MySQL Support Engineer, Sun Microsystems GmbH MySQL User Manual:http://dev.mysql.com/doc/refman/5.0/en/ MySQL User Forums:http://forums.mysql.com/ |
![]() |
| Thread Tools | |
| Display Modes | |
| |