How does Index Scan get used - Mailing list pgsql-sql

From Samuel J. Sutjiono
Subject How does Index Scan get used
Date
Msg-id 018a01c1bbaf$befb84b0$110a010a@headquarters.wcgroup.com
Whole thread Raw
Responses Re: How does Index Scan get used  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: How does Index Scan get used  (Oliver Elphick <olly@lfix.co.uk>)
Re: How does Index Scan get used  (Frank Bax <fbax@sympatico.ca>)
List pgsql-sql
 
I tried an Index Scan but I kept on getting Seq Scan. Do you know why ? What do I need to do to get my query to use index scan (I tried to turn it on  by doing SET ENABLE_indexscan = on; but it didn't work)
 
create table test (test_col text);
create index test_index on test (test_col);
insert into test values ('abc.xyz');
insert into test values ('abcxyz');
insert into test values ('abc/xyz');
explain select * from test where test_col like 'abc/%';
 
NOTICE:  QUERY PLAN:
 
Seq Scan on test  (cost=0.00..22.50 rows=10 width=12)
 
Another question:
Does Regex (~*) or like use table scan ?
 
Thanks,
Sam
_________________________________________________
 Expand your wireless world with Arkdom PLUS
 http://www.arkdom.com/

pgsql-sql by date:

Previous
From: "pauLSiew"
Date:
Subject: Re: SQL: Are the "" around table & coloumnames necessary?
Next
From: "Samuel J. Sutjiono"
Date:
Subject: Page Management