[development] auto_increment

Moshe Weitzman weitzman at tejasa.com
Mon Dec 12 15:12:01 UTC 2005


Knite wrote:
> This has probably been discussed in depth before, and I've found a few
> nodes on drupal.org that captured some of the ideas, but I'm relatively
> new to this list, so please forgive me and enlighten me if there's more
> history I should know about.

A long time ago, we made a big effort to be database independent and 
introducing our own sequences feature was part of that. We wanted to 
welcome all RDMS, even those without sequences.
> 
> AUTO_INCREMENT looks like a database feature that is supported in the
> databases that drupal currently supports, namely mysql and pgsql.  From
> what I gather from documentation at mysql.org and from previous comments
> in our forums, it seems that AUTO_INCREMENT is an improvement over the
> current system of creating nid's using the sequence table (and having to
> lock it).
> 
> I'd like to look into moving drupal to use auto-increment instead of
> table locking, for both performance reasons (1 query vs 3) and webhost
> compatibility reasons.  (There are some webhosts that do not grant LOCK
> TABLE permission.)

Now that we have a few years of experience with sequences, I'll agree 
that this feature causes a few problems with permissions, is a small 
performance hit, and should be dropped. I'd support a patch that removed 
drupal sequences in favor of built in auto-increment and such. I just 
don't see anyone building support for new databases and especially not 
those that lack native sequences.

-moshe


More information about the development mailing list