Re: Re: Query not using index

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: Query not using index
Дата
Msg-id 25265.989530995@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Re: Query not using index  (Chris Jones <chris@mt.sri.com>)
Список pgsql-general
Chris Jones <chris@mt.sri.com> writes:
>> Ah.  You must have a few values that are far more frequent (like tens of
>> thousands of occurrences?) and these are throwing off the planner's
>> statistics.

> I had a similar situation, where I had a lot of rows with 0's in
> them.  Changing those to NULLs worked wonders.

Yes, if you have a lot of "dummy" values it's a good idea to represent
them as NULLs rather than some arbitrarily-chosen regular data value.
The planner does keep track of NULLs separately from everything else.

            regards, tom lane

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

Предыдущее
От: Chris Jones
Дата:
Сообщение: Re: Re: Query not using index
Следующее
От: Tom Lane
Дата:
Сообщение: Re: formatting a date