Re: bad selectivity estimates for CASE

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: bad selectivity estimates for CASE
Дата
Msg-id 603c8f070901060425t485fb8d8nb79735ed72982d5a@mail.gmail.com
обсуждение исходный текст
Ответ на Re: bad selectivity estimates for CASE  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: bad selectivity estimates for CASE  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On Mon, Jan 5, 2009 at 11:40 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Robert Haas" <robertmhaas@gmail.com> writes:
>> While looking at a complex query that is being poorly planned by
>> PostgreSQL 8.2.9, I discovered that any non-trivial CASE...WHEN
>> expression seems to produce a selectivity estimate of 0.005.
>
> If you have an idea for a non-silly estimate, feel free to enlighten
> us...

Well, presumably CASE WHEN <expr1> THEN <constant1> WHEN <expr2> THEN
<constant2> WHEN <expr3> THEN <constant3> ... END = <constantn> could
be simplified to <exprn>.  But that's not going to happen in time to
do me any good on this query, if it ever happens (and might not be
sufficient anyway since the selectivity estimates of <expr1> may not
be very good either), so I was more looking for suggestions on coping
with the situation, since I'm sure that I'm not the first person to
have this type of problem.

...Robert

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

Предыдущее
От: "Dmitry Koterov"
Дата:
Сообщение: Re: Bgwriter and pg_stat_bgwriter.buffers_clean aspects
Следующее
От: Tom Lane
Дата:
Сообщение: Re: bad selectivity estimates for CASE