Subject Re: [firebird-support] Is some API to get generator value?
Author Doug Chamberlin
On 4/12/11 8:23 AM, Kjell Rilbe wrote:
> Den 2011-04-12 14:19 skrev Doug Chamberlin såhär:
>> Transactions are
>> very, very inexpensive in Firebird if no data from records is accessed
>> and no data from records is changed. Since you need a round trip from
>> the client to the server to get the generator value you cannot avoid
>> that communication expense. The rest is lost in the shuffle.
> So if no data records are touched, the server will not suffer from those
> expensive disk seeks that are so prominent whenever you commit with
> forced writes on?
Well, what else is the server doing when these transactions are being

The Transaction Inventory Page is where the status of the transaction is
kept and it is probably the hottest hotspot in the database. It is
getting updated and written heavily. However, to use up another
transaction (2 bits) in this way is insignificant.

In an artificially contrived situation where you are the ONLY user of
the database and ONLY doing reads of generator values and NO other
transactions at all then, yes, the TIP would be written to disk for no
other reason than to record your transactions that were wrapping the
generator access. But that is truly an artificially contrived situation
and should not guide anyone's decisions or affect evaluation of the fact
that transactions wrap all server access (except in an academic way).

So, I guess it really depends on what you mean by "suffer". In 15 years
of Firebird use have never heard of or experienced any noticeable delay,
expense, problem, or concern due to the fact that a single generator
access needs to be wrapped in a transaction. Of course, the only way
you can determine if the server operation is a problem for you is to
test it.