Re: Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)
Дата
Msg-id 16907.1112883624@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Recognizing range constraints (was Re: Plan for relatively simple query seems to be very inefficient)  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-hackers
Bruno Wolff III <bruno@wolff.to> writes:
>   Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Can anyone suggest a more general rule?

> I think it makes sense to guess that a smaller fraction of the rows will
> be returned when a column value is bounded above and below than if it
> is only bounded on one side, even if the bounds aren't fixed. You can
> certainly be wrong.

Yeah, the whole thing is only a heuristic anyway.  I've been coming
around to the view that relation membership shouldn't matter, because
of cases like

    WHERE a.x > b.y AND a.x < 42

which surely should be taken as a range constraint.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 'now' runtime
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Recognizing range constraints (was Re: [PERFORM] Plan for relatively simple query seems to be very inefficient)