Re: Huge Data
Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
From: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
To: pgsql-general@postgresql.org
Date: 2004-01-14T13:02:45Z
Lists: pgsql-general
On Wednesday 14 January 2004 18:09, Sezai YILMAZ wrote: > Richard Huxton wrote: > >PG uses MVCC to manage concurrency. A downside of this is that to verify > > the exact number of rows in a table you have to visit them all. > > > >There's plenty on this in the archives, and probably the FAQ too. > > > >What are you using the count() for? > > select logid, agentid, logbody from log where logid=3000000; How about select logid, agentid, logbody from log where logid='3000000'; or select logid, agentid, logbody from log where logid=3000000::int4 Basically you need to typecast the constant. Then it would use the index. I am not sure of first form of it though. I recommend you use the later form. Shridhar