Re: systables.nrows vs count(*)
Posted in 1997
manoj@mailhost.twowaytv.co.uk (Manoj) wrote: :All, : :When users insert into a table the nrows is not updated. : :Is this normal ? : :(informix 7.22 dsa /solaris 2.5.1) Yes, it's normal. nrows is only updated when you execute an update statistics statement. This is for performance reasons. However the total count of rows is updated somewhere (with some index possibly) so when you do a select count(*) from sometable it returns the count almost instantaneously (as opposed to some other well known databases who actually scan the whole table to do this kind of a count). Obviously if you include a where clause the table or index is scanned. Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org