Re: [HACKERS] using indexes

Thomas Lockhart <lockhart@alumni.caltech.edu>

From: "Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
To: Sferacarta Software <sferac@bo.nettuno.it>
Cc: pgsql-hackers@postgreSQL.org
Date: 1998-10-19T14:46:59Z
Lists: pgsql-hackers
Sferacarta Software wrote:
> 
> Hello all,
> 
> I have a table SP with a primary key SNO,
> I'm trying if v6.4beta2 uses indexes
> but seems it uses indexes only with '=' operator:

regression=> explain select unique1 from onek where unique1 < 3;
NOTICE:  QUERY PLAN:

Index Scan using onek_unique1 on onek  (cost=28.67 size=334 width=4)

> prova=> explain select * from sp where sno = 'S1';
> NOTICE:  QUERY PLAN:
> Index Scan using sp_pkey on sp  (cost=0.00 size=0 width=28)
> EXPLAIN

Looks like maybe you need to vacuum to get statistics for the optimizer?

                  - Tom