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


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to