Subject | RE: [firebird-support] Re: max() on primary key very slow |
---|---|
Author | Leyne, Sean |
Post date | 2012-02-10T19:55:17Z |
Woody,
As Ann has pointed out, generators/sequences are a much better approach.
Sean
> Since you control all the access, why not create an ID table that holds theThat would approach could introduce transaction concurrency issues.
> 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.
> :)
As Ann has pointed out, generators/sequences are a much better approach.
Sean