Subject RE: [firebird-support] Re: max() on primary key very slow
Author Leyne, Sean
Woody,

> Since you control all the access, why not create an ID table that holds the
> next ID for each table instead of relying on the speed of MAX? It's no more
> dangerous in a multi-user environment and as a matter of fact, given the
> proper attention to locking, is much safer and easier to deal with. I do this
> with many of my relations and have never had any problems with multiple
> users. It also eliminates any speed issues no matter which database you use.
> :)

That would approach could introduce transaction concurrency issues.

As Ann has pointed out, generators/sequences are a much better approach.


Sean