Re: fool-toleranced optimizer

Поиск
Список
Период
Сортировка
От Kevin Brown
Тема Re: fool-toleranced optimizer
Дата
Msg-id 20050310000137.GB30977@filer
обсуждение исходный текст
Ответ на Re: fool-toleranced optimizer  (Neil Conway <neilc@samurai.com>)
Ответы Re: fool-toleranced optimizer  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
Neil Conway wrote:
> Simon Riggs wrote:
> >Oleg is saying that the optimizer doesn't protect against foolish SQL
> >requests. His query is an example of a foolishly written query.
> 
> IMHO calling this a "foolishly written query" is completely arbitrary. I 
> can imagine plenty of applications for which a cartesian join makes 
> sense. In this case the user didn't write the query they meant to write 
> -- but it is surely hopeless to prevent that in the general case :)

Sure, but this case, at least, is (hopefully) easily detectable (as
such things go), has a high cost when it occurs, and is *usually* not
what the user intended.

Hence, it makes sense to go ahead and run the query, but issue a
warning at the very beginning, e.g. "WARNING: query JOINs tables <list
of tables> without otherwise referencing or making use of those
tables.  This may cause excessively poor performance of the query".


That said, the real question is whether or not it's worth putting in
the effort to detect this condition and issue the warning.  I'd say
probably not, but if this is a big enough itch for someone then why
should we discourage them from coding up a fix?



-- 
Kevin Brown                          kevin@sysexperts.com


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1528: Rows returned that should be excluded by WHERE clause
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: pgpool question