Purpose of Sequence table in Mysql?

Lancelight - January 23, 2008 - 00:00

I have looked for threads that have discussed what the purpose of the "sequence" table is in a mysql environment but havent been able to find any which was really surprising. I'd think this issue would be a hot topic. I've had multiple problems when importing things as nodes into a drupal DB such as a bunch of text articles and every time I always have to update the sequence table with whatever ID auto_increment gives me. Since mysql keeps track of the ID's, isnt this a pretty redundant table and un-needed? I dont know about other DB types, maybe they dont do auto-increment tracking, but what DB wouldnt? To me this seems like a completely un-necessary step and should be completely ripped out or at least turned off if the DB engine being used is mysql.

The sequence table is used

jaydub - March 2, 2008 - 08:09

The sequence table is used _instead_ of using a MySQL auto_increment or PostgreSQL serial column.

Because of the differing methods of creating auto_increment/serial type columns in different databases, Drupal in the past has used plain INTEGER columns and used the sequence table to store an ID value to act as an auto_increment/serial type column.

Some contrib modules use the sequence method, which requires the use of db_next_id() function and some contrib modules use native MySQL or PostgreSQL sequence columns.

From what I understand Drupal 6 has moved in the direction of using native sequence columns so I think you will see the sequence table disappear in the future.

Thank god for that! I cant

Lancelight - March 12, 2008 - 22:11

Thank god for that! I cant stand the use of the sequence table. It just made no sense to me at all :(. I truelly hope that someone sees the light and does away with it.

 
 

Drupal is a registered trademark of Dries Buytaert.