How does Index Scan get used

From: "Samuel J(dot) Sutjiono" <ssutjiono(at)wc-group(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: How does Index Scan get used
Date: 2002-02-22 14:46:30
Message-ID: 018a01c1bbaf$befb84b0$110a010a@headquarters.wcgroup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Samuel J. Sutjiono 2002-02-22 15:13:47 Page Management
Previous Message Graham Vickrage 2002-02-22 13:18:51 quotes nightmare!