Re: Planner not using column limit specified for one column for another column equal to first

Поиск
Список
Период
Сортировка
От Віталій Тимчишин
Тема Re: Planner not using column limit specified for one column for another column equal to first
Дата
Msg-id n2o331e40661004162112u52e89c27i77dbade091133df4@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Planner not using column limit specified for one column for another column equal to first  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Planner not using column limit specified for one column for another column equal to first  (Matthew Wakeling <matthew@flymine.org>)
Список pgsql-performance


16 квітня 2010 р. 17:19 Tom Lane <tgl@sss.pgh.pa.us> написав:
Віталій Тимчишин <tivv00@gmail.com> writes:
> I've thought and someone in this list've told me that this should be done
> automatically.

As was pointed out, even if we had such logic it wouldn't apply in this
example, because the equality conditions aren't real equalities but
OUTER JOIN conditions.


In this case you can copy condition to "ON" condition, not to where cause and this would work correct, e.g. "select something from a join b on a.x=b.y where a.x > n" <=> "select something from a join b on a.x=b.y and b.y > n where a.x > n".

As of making planner more clever, may be it is possible to introduce division on "fast queries" and "long queries", so that if after fast planning cost is greater then some configurable threshold, advanced planning techniques (or settings) are used. As far as I have seen in this list, many techniques are not used simply because they are too complex and could make planning take too much time for really fast queries, but they are vital for long ones.
Also same (or similar) threshold could be used to enable replanning for each run of prepared query - also an often complaint is that planned query is not that fast as is could be.
 
--
Best regards,
Vitalii Tymchyshyn

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

Предыдущее
От: Josh Kupershmidt
Дата:
Сообщение: Re: stats collector suddenly causing lots of IO
Следующее
От: Matthew Wakeling
Дата:
Сообщение: Re: Planner not using column limit specified for one column for another column equal to first