Re: serial
Posted in 1999
Topics: Data Types & Schema Design
>>>> "Robert Taylor" <robertt@scotlegal.com> 08/12/99 11:51AM >>> >>Anyway*, serial data types will accept values less than 0 (I've just tried >this :-), but the autogeneration of serial numbers is always for positive > >Sorry but I don't think this is *always* the case - I think the the positive >numbers are exhausted then negative numbers will start to be allocated until >that too is exhausted. > AFAIK it'll wrap at 2G and start using unused numbers from 0 again, but I suspect it'll be engine dependent as SE can only have 2G rows per table, whereas Online it's 4G rows per fragment. This begs the question as what happens on a >2GB row Online table that has a serial column? Paul Watson WF Software Ltd Tel: +44 1436 674729 Fax: +44 1436 678729 www.wfsoftware.com/informix # If you broke it, hide the evidence ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************
It is often mentioned that serial columns should not be a primary key for this reason. When the maximum number is hit, the sequence wraps (but stays positive). However, the next number is 1, whether it exists or not. The engine does not check if there is already an entry. PS: 9.2 has SERIAL8 (8 byte serial number). Paul watson (watsop@russellcorp.co.uk) wrote: : >>>> "Robert Taylor" <robertt@scotlegal.com> 08/12/99 11:51AM >>> : >>Anyway*, serial data types will accept values less than 0 (I've just tried : >this :-), but the autogeneration of serial numbers is always for positive : > : >Sorry but I don't think this is *always* the case - I think the the positive : >numbers are exhausted then negative numbers will start to be allocated until : >that too is exhausted. : > : AFAIK it'll wrap at 2G and start using unused numbers from 0 again, but I suspect it'll be engine dependent as SE can only have 2G rows per table, whereas Online it's 4G rows per fragment. This begs the question as what happens on a >2GB row Online table that has a serial column? : Paul Watson : WF Software Ltd : Tel: +44 1436 674729 : Fax: +44 1436 678729 : www.wfsoftware.com/informix : # If you broke it, hide the evidence : ********************************************************************** : This email and any files transmitted with it are confidential and : intended solely for the use of the individual or entity to whom they : are addressed. If you have received this email in error please notify : the system manager. : This footnote also confirms that this email message has been swept by : MIMEsweeper for the presence of computer viruses. : www.mimesweeper.com : ********************************************************************** -- Rob Wilson rwilson@ntsource.com