Subject Select max(id) is slow ?
Author Carsten Schäfer
Hi,
I have a normal auto-increment primary key (id_apos) on a table
t_apos
(generator gen_apos that is used in a before insert trigger).
Now i want to put the new id that is given from the generator in my
object that was inserted.
I use 'select max (id_apos) from t_apos' to get the highest id from
the table (insert and select in one transaction).
This seems to be relative slow. (PLAN (T_APOS NATURAL)).
Can i get the max(id_apos) somehow faster ? (query on the generator,
stored procedure that returns the max(id_apos))
I'm using Firebird Beta2 on Win2kSP2 with InterClient 2.

gruse
Carsten