Re: How does Index Scan get used

Поиск
Список
Период
Сортировка
От Luis Amigo
Тема Re: How does Index Scan get used
Дата
Msg-id 3C767A25.78D224AA@atc.unican.es
обсуждение исходный текст
Ответ на Re: How does Index Scan get used  (Holger Marzen <holger@marzen.de>)
Список pgsql-general
 
> >
> > 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');
> >
 
First of all when you create an index u must specify what kind of ops will use that index, in this case create index test_index on test (test_col , text_ops)
Second, a index only will be used if there is an advantage on using it, in this case, u have 3 unique values, unless random-page cost is lower than 3, planner would not use it.
Third of all, if u want to learn how to use indexes, try numeric values first, because indexing texts is a bit more difficult.
Вложения

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

Предыдущее
От: "Samuel J. Sutjiono"
Дата:
Сообщение: Regular Expression for 'and' instead of 'or'
Следующее
От: Jean-Luc Lachance
Дата:
Сообщение: Re: environment variables, output format & setting current