Subject Re: MAX(ID) Performance
Author majstor
Hi,
>
> You need an DESCENDING index on ID.
Ok, this trick is solved my problem for now, but I have same ordering details by ID field where I musn't use DESC indexing.
>
> Btw, if you need that to do something like MAX(ID) + 1 for implementing
> an auto-increment thingy, then you'd better try generators in Firebird.
> Aka sequences in Oracle.
I'm using generators in firebird trigered by on insert event triger in database, but when I need to know ne ID value on client for a new 100 records and when I have about 50 clients I cant fetch new generator value because of performance, so I fetch last ID (or actual generator value) and internal generate new values and than set up new value to generator (it mean that I define new value on client)!

Thanks for help

>
>
> --
> Best Regards,
> Thomas Steinmaurer
> LogManager Series - Logging/Auditing Suites supporting
> InterBase, Firebird, Advantage Database, MS SQL Server and
> NexusDB V2
> Upscene Productions
> http://www.upscene.com
> My blog:
> http://blog.upscene.com/thomas/
>