Re: How does Index Scan get used

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How does Index Scan get used
Дата
Msg-id 17992.1014400707@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How does Index Scan get used  ("Samuel J. Sutjiono" <ssutjiono@wc-group.com>)
Список pgsql-general
"Samuel J. Sutjiono" <ssutjiono@wc-group.com> writes:
> 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=3D0.00..22.50 rows=3D10 width=3D12)

I did the above and got:

regression=# explain select * from test where test_col like 'abc/%';
NOTICE:  QUERY PLAN:

Index Scan using test_index on test  (cost=0.00..17.07 rows=5 width=32)

Perhaps you are using a locale that prevents LIKE from being optimized
into an indexscan?  See
http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/charset.html#AEN16601

            regards, tom lane

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

Предыдущее
От: tony
Дата:
Сообщение: moving to 7.2
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Does iscachable work?