4 ms·
Autoincrement is good sometimes: we had some problems with slow inserts in a production SQL server. It turned out that the problem was that the primary key was
by GFischer 16y ago
Autoincrement is good sometimes: we had some problems with slow inserts in a production SQL server.
It turned out that the problem was that the primary key was set up as a clustered index, and we were doing inserts in a non sequential way, so the server had to rearrange the B-tree every time a row was inserted.
So yes, sorting your index sequentially can have important performance benefits (at least for Microsoft SQL Server and clustered indexes, and a table with lots of inserts).
Edit: read the above link, it only says not to use an URL with identifiers (I can agree with that), and that MySQL with InnoDB has some problems with clustered indexes. The title is very misleading.