vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Peter Lauri wrote: > DELETE FROM table Truncate will be a lot better. DELETE FROM table will do it row by row which also means it will have to update any indexes applicable to the table as it goes... Lots of data & lots of indexes = very slow. |
| |||
| But how will that interact with the auto increment counter? Will truncate reset the counter. Chris wrote: > > Peter Lauri wrote: > > DELETE FROM table > > Truncate will be a lot better. > > DELETE FROM table will do it row by row which also means it will have to > update any indexes applicable to the table as it goes... > > Lots of data & lots of indexes = very slow. -- Chris Wagner CBTS GE Aircraft Engines Chris.Wagner@ae.ge.com |
| ||||
| Wagner, Chris (GEAE, CBTS) wrote: > But how will that interact with the auto increment counter? Will > truncate reset the counter. According to the docs it will: http://dev.mysql.com/doc/refman/5.1/en/truncate.html The table handler does not remember the last used AUTO_INCREMENT value, but starts counting from the beginning. This is true even for MyISAM and InnoDB, which normally do not reuse sequence values. |