using indexes

jose' soares <sferac@bo.nettuno.it>

From: Sferacarta Software <sferac@bo.nettuno.it>
To: pgsql-hackers@postgresql.org
Date: 1998-10-19T11:09:58Z
Lists: pgsql-hackers
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:

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

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

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

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

  Jose'