Re: How does Index Scan get used - Mailing list pgsql-general

From Holger Marzen
Subject Re: How does Index Scan get used
Date
Msg-id Pine.LNX.4.44.0202221624390.20993-100000@bluebell.marzen.de
Whole thread Raw
In response to How does Index Scan get used  ("Samuel J. Sutjiono" <ssutjiono@wc-group.com>)
List pgsql-general
On Fri, 22 Feb 2002, Samuel J. Sutjiono wrote:

> 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
indexscan (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)

Did you do a vacuum analyze after creating the index?


pgsql-general by date:

Previous
From: Fran Fabrizio
Date:
Subject: Does iscachable work?
Next
From: "Samuel J. Sutjiono"
Date:
Subject: Re: How does Index Scan get used