in reply to Re: Re: Re: Re^2: Message Reply Sequencing
in thread Message Reply Sequencing

The fact that Oracle (Sybase does too) leaves "holes" has all to do with performance. With properly written SQL, it's not necessary that the sequence is continuous, as long as the elements are unique (so you can use them as a unique key), and monotonous (so you can do an 'order by' on them). I wouldn't use a trigger for that if performance mattered.

Abigail

Replies are listed 'Best First'.
Re: Re: Message Reply Sequencing
by mpeppler (Vicar) on Dec 05, 2003 at 16:25 UTC
    You can minimize the holes in the sequence for Sybase by using the identity_gap attribute, available in 12.0 and later releases of Sybase:
    create table foo ( id numeric(9) identity, .... ) with identity_gap = 1
    This would limit the potential gap in the sequence to 1, at some performance cost in the identity value generation.

    Michael