Re: The planner hates me.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: The planner hates me.
Дата
Msg-id 8406.1222360912@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: The planner hates me.  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Список pgsql-general
"Scott Marlowe" <scott.marlowe@gmail.com> writes:
> On Thu, Sep 25, 2008 at 9:38 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The problem you've got here is that the planner has got absolutely no
>> visibility into the behavior of get_dates().

> Couldn't they make a simple immutable function and index on that?

Maybe, but I can't think of a different index definition that would work
better.

The Right Way (tm) to do this would be something like

    create temp table dates as select * from get_dates(...);
    analyze dates;
    ... original select, but join against temp table ...

which would leave the planner armed with some stats about the range
of dates of interest.  Unfortunately, this isn't going to help Jeff
today, because scalargtjoinsel/scalarltjoinsel are just stubs :-(.
It's not an area of the planner than anyone's ever got round to working
on.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: regexp_replace() [noindex] thing
Следующее
От: Marcus Engene
Дата:
Сообщение: Re: regexp_replace() [noindex] thing