Re: PostgreSQL doesn't use indexes even is enable_seqscan

Поиск
Список
Период
Сортировка
От Ricardo Junior
Тема Re: PostgreSQL doesn't use indexes even is enable_seqscan
Дата
Msg-id Pine.LNX.4.44.0207090039030.642-100000@ricardo.localdomain
обсуждение исходный текст
Ответ на Re: PostgreSQL doesn't use indexes even is enable_seqscan  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
    Hi there,

> > I have a severe problem with PostgreSQL 7.2.1.
> > I have a table containing 500mio records (for testing purposes).
> > Indexes: idx_one_xmod
> > Unique keys: idx_one_id
> >
> > cluster=# SET enable_seqscan TO off;
> > SET VARIABLE
> > cluster=# SELECT * FROM one WHERE id=300000;

> You'll need to quote or explicitly cast the
> constant to bigint for the indexes to get used.
> It's a problem with the way numeric constants are
> handled.  They'll get prematurely forced to int4
> if they fit, and won't promote for index use.

    Perhaps this should be added to the Documentation in the indexes
part. I had the same problem last week and I guess it's a very common and
frequent question.

    []'s
    Ricardo.





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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Speeding up subselect ?
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: I am being interviewed by OReilly