Paul, ----- Original Message ----- From: ""Paul Chu"" <[EMAIL PROTECTED]> Newsgroups: mailing.database.myodbc Sent: Saturday, June 19, 2004 5:07 AM Subject: RE: Clustered Index - Where is data inserted ? Not Answered
> Appreciate any help at all > > Thanks, Paul > > > -----Original Message----- > From: Paul Chu [mailto:[EMAIL PROTECTED] > Sent: Friday, June 18, 2004 10:16 AM > To: [EMAIL PROTECTED] > Subject: Clustered Index - Where is data inserted ? > > Hi, > > Can someone explain how the data is stored in a table using a clustered > index. > > Does this mean that the data is inserted in the .myd file in sorted > index order ? MyISAM does not have clustered indexes. InnoDB has a clustered index on every table, and normally it is on the PRIMARY KEY. > If so, how is space made to insert the new records ? > Does this make inserting records slow because data is being inserted in > physical sort order in the table ? For large tables, people usually insert new rows at the high end of the PRIMARY KEY, since the key is usually a generated id. Splitting B-tree pages at the index end is very efficient. In this case having a clustered index poses no overhead. But if you insert records randomly on the PRIMARY KEY, then B-tree page splits waste disk space, and that will reduce performance somewhat. > Thanks, Paul Best regards, Heikki Tuuri Innobase Oy Foreign keys, transactions, and row level locking for MySQL InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM tables http://www.innodb.com/order.php Order MySQL technical support from https://order.mysql.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]