Subject Re: [firebird-support] Re: Generators for auto-increment - with override
Author Ann W. Harrison
Adam wrote:
> Calls to generators are threadsafe, which means they must use some
> form of mutex locking. The only possible bottleneck I can see is the
> excessive calls to the generator, but I really doubt that will become
> an issue.

The "mutex" is the lock on the page that contains the generator value.
That page is normally in cache, so the cost of the operation is
approximately switching from a read lock to a write lock - very low -
and the same whether you add 1 or 100 to the value. The generator page
is written every time a transaction that changed it commits, which is
another cost.