Re: That is where we started -- for next number
Posted in 1993
Topics: General Discussion
> }>> Subject: Re: Cheryl - 'nest number' > }>> Date: 25 Aug 1993 09:46:27 +0200 > }>> Reply-To: Knut Espen Vonheim <knutv@hadrian.boers.no> > }>> Organization: Oslo B|rs Informasjon > }>> > }>> > }>> Cheryl! > }>> > }>> If you want to use smallint instead of serial (save diskspace etc) > }>> you could try: > }>> > }>> $select max(nsnkey)+1 into $newkey from nsn > }>> > }>> > }>> That should give you the next number and i should be unique. > }>> > }>> > > That is where we started. Someone posted a message about this taking > too long. My process for getting the next number takes less than > a second. The sequential search takes too long, I've had problems > with serial fields, and want to stay smallint, if possible. > > Sometimes, I'm using this number to build a larger reference record. > > cheryl So, how does INFORMIX derive the next sequential value for a serial field? a. Does it do a select max(serial fieldname) +1 or b. Does it retrieve this value from an internally maintained table ( like the ORACLE sequence ) and update it every time it gets a value? If (a) is true, then it would be better to use an artificially maintained table else, the serial type should be good enough to retrieve the "next number". Thanks, E.G.Nadhan egn@i88.isc.com