Re: Optimizer : query rewrite and execution plan ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Optimizer : query rewrite and execution plan ?
Дата
Msg-id 9924.1202313626@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Optimizer : query rewrite and execution plan ?  (Theo Kramer <theo@flame.co.za>)
Ответы Re: Optimizer : query rewrite and execution plan ?  (Simon Riggs <simon@2ndquadrant.com>)
Список pgsql-performance
Theo Kramer <theo@flame.co.za> writes:
> On Wed, 2008-02-06 at 11:53 +0000, Simon Riggs wrote:
>> Since the SQL is not your fault and difficult to control, it is an
>> argument in favour of an optional planner mode that would perform
>> additional checks for redundant clauses of various kinds. The default
>> for that would be "off" since most people don't suffer from this
>> problem. BO isn't the only SQL generating-client out there, so I think
>> this is a fairly wide problem.

> I would have to disagree. I spend a lot of time writing code that
> generates SQL from a business app and feel strongly that any
> optimisation is my responsibility.

Disagree with what?  If that's your feeling then you'd leave the setting
"off", and no harm done.

We used to have code that removed duplicate WHERE clauses (check the
revision history for prepqual.c).  It was taken out because it consumed
excessive amounts of planning time without accomplishing a darn thing
for most queries.  There is no chance that it will be put back in as the
only behavior, or even the default behavior, but I can see the reasoning
for offering an option as Simon suggests.

            regards, tom lane

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

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Benchmark Data requested --- pgloader CE design ideas
Следующее
От: Luke Lonergan
Дата:
Сообщение: Re: Benchmark Data requested --- pgloader CE design ideas