Re: [SQL] why is PG NOT pushing where clause to VIEW ? Resulting inbad performance.

Поиск
Список
Период
Сортировка
От Herwig Goemans
Тема Re: [SQL] why is PG NOT pushing where clause to VIEW ? Resulting inbad performance.
Дата
Msg-id CAKaDz_GHq5KTGQ4iFS5g2DrNVZkaBdFZj=eQ-mmWocOuBbQZ_A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [SQL] why is PG NOT pushing where clause to VIEW ? Resulting in bad performance.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Hello,

I do not see how pushing this clause to to the view can alter in any way the result. If the latter is true, it is obvious to implement this. A short test without data in another database showed no change in plan with or without the extra clause, in fact it said access predicates on currency view on ID and on wsid. So it looks to me this is a opportunity for PG to add these predicates. The benefit performante wise is huge: the query goes down from 4-6s elapsed time to less than 1s.
Kind regards and thanks for the help.
Herwig


Op 7 feb. 2017 5:37 p.m. schreef "Tom Lane" <tgl@sss.pgh.pa.us>:
Herwig Goemans <herwig.goemans@gmail.com> writes:
> I am wondering why a certain query is NOT pushing the where clause to the
> view. See query and explain plan:

There's no provision for transitively applying IN clauses to other
variables.  I'm not entirely sure whether it would be a good idea,
but in any case, it's not there and not planned.

                        regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] why is PG NOT pushing where clause to VIEW ? Resulting in bad performance.
Следующее
От: Mike Wes
Дата:
Сообщение: [SQL] Problem wil TIMEZONE vs TIME ZONE