Re: [HACKERS] using indexes - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] using indexes
Date
Msg-id 362B50E3.C529DDDE@alumni.caltech.edu
Whole thread Raw
In response to using indexes  (Sferacarta Software <sferac@bo.nettuno.it>)
List 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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Recent Makefile changes (was Re: unique indexes and pqlib)
Next
From: "Thomas G. Lockhart"
Date:
Subject: Re: cpp preprocessor problem in postgres