Re: PostgreSQL doesn't use indexes even is enable_seqscan = off

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: PostgreSQL doesn't use indexes even is enable_seqscan = off
Дата
Msg-id 200207081739.41553.dev@archonet.com
обсуждение исходный текст
Ответ на PostgreSQL doesn't use indexes even is enable_seqscan = off  (Hans-Juergen Schoenig <hs@cybertec.at>)
Список pgsql-general
On Sunday 07 Jul 2002 9:48 am, Hans-Juergen Schoenig wrote:
> The index was created properly but somehow it isn't used:
>
> cluster=# \d one
>           Table "one"
>   Column |  Type   | Modifiers
> --------+---------+-----------
>   id     | bigint  |
>   even   | boolean |
>   xmod   | integer |
> Indexes: idx_one_xmod
> Unique keys: idx_one_id
>
> cluster=# SET enable_seqscan TO off;
> SET VARIABLE
> cluster=# SELECT * FROM one WHERE id=300000;

try... WHERE id=300000::bigint
or... WHERE id='300000'

Postgres thinks the 300000 is of type int then fails to find an index of that
type.

Search the archives for "bigint" and "index" for loads on this.

- Richard Huxton



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

Предыдущее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: pgaccess problems
Следующее
От: terry@greatgulfhomes.com
Дата:
Сообщение: Re: I am being interviewed by OReilly