[development] Why do we avoid auto-incrementing db columns?

Zohar Stolar z.stolar at gmail.com
Wed Apr 25 14:23:38 UTC 2007

Here's my guess:
When inserting a node, there are several operations that take place, and 
you want them all to use a persistent $node->nid .
Since few node creations can occur in the same time, you want to know 
which one is YOUR node.
Fetching an nid/tid/... from the sequence table makes sure each one 
works in a safe environment, where all IDs are known.

...But that's just a guess ;-)

Barry Jaspan wrote:

> Could someone either clue me in or point to a prior discussion about
> why Drupal avoids using auto-incrementing database columns?  If it is
> database compatibility, which versions of which databases that we
> support do not have it?
> Thanks,
> Barry

More information about the development mailing list