Re: Why my queryes doesnt not use indexes?

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Why my queryes doesnt not use indexes?
Дата
Msg-id 20090622232223.GO5407@samason.me.uk
обсуждение исходный текст
Ответ на Why my queryes doesnt not use indexes?  (DaNieL <daniele.pignedoli@gmail.com>)
Список pgsql-general
On Mon, Jun 22, 2009 at 08:43:43AM -0700, DaNieL wrote:
> Hi guys, i am in trouble with some simple data that seem like doesnt
> use any index.. and i dont know why.

It can be for a couple of reasons; firstly using an index isn't always a
good thing.  In your case I'd guess you probably want to probably want
to do the following when creating the index:

> CREATE INDEX users_nick_index ON users (nickname varchar_pattern_ops);

That will allow PG to use the index in LIKE expressions.  For more
details see:

  http://www.postgresql.org/docs/current/static/indexes-opclass.html

--
  Sam  http://samason.me.uk/

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

Предыдущее
От: Sam Mason
Дата:
Сообщение: Re: Slight change in query leads to unexpected change in query plan
Следующее
От: Andrew Maclean
Дата:
Сообщение: Re: postgresql-8.3.7 unexpected connection closures