How does Index Scan get used

Поиск
Список
Период
Сортировка
От Samuel J. Sutjiono
Тема How does Index Scan get used
Дата
Msg-id 016501c1bbae$ea51fd70$110a010a@headquarters.wcgroup.com
обсуждение исходный текст
Ответы Re: How does Index Scan get used  (Holger Marzen <holger@marzen.de>)
Re: How does Index Scan get used  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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
 
 

В списке pgsql-general по дате отправления:

Предыдущее
От: Jean-Michel POURE
Дата:
Сообщение: UTF-8 lenght of a string
Следующее
От: Pam Wampler
Дата:
Сообщение: Re: number of connections to postmaster