Re: Bad estimation for "where field not in"

Поиск
Список
Период
Сортировка
От Ants Aasma
Тема Re: Bad estimation for "where field not in"
Дата
Msg-id CA+CSw_vALyg5x-2ynK-tNpgtv9Yw41ZQx=C5enc0QFjzk7A=Dg@mail.gmail.com
обсуждение исходный текст
Ответ на Bad estimation for "where field not in"  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Ответы Re: Bad estimation for "where field not in"
Список pgsql-performance
On Thu, Mar 1, 2012 at 6:40 PM, Daniele Varrazzo
<daniele.varrazzo@gmail.com> wrote:
> Is this a known planner shortcoming or something unexpected, to be
> escalated to -bugs? Server version is 9.0.1.

The relevant code is in scalararraysel() function. It makes the
assumption that element wise comparisons are completely independent,
while the exact opposite is true. This has been this way since
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=290166f93404d8759f4bf60ef1732c8ba9a52785
introduced it to version 8.2.

At least for equality and inequality ops it would be good to rework
the logic to aggregate with
s1 = s1 + s2 and s1 = s1 + s2 - 1 correspondingly.

--
Ants Aasma

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [planner] Ignore "order by" in subselect if parrent do count(*)
Следующее
От: Craig James
Дата:
Сообщение: Re: [planner] Ignore "order by" in subselect if parrent do count(*)