Re: [8.4] Updated WITH clause patch (non-recursive)

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Re: [8.4] Updated WITH clause patch (non-recursive)
Дата
Msg-id 479DE557.5070300@phlo.org
обсуждение исходный текст
Ответ на Re: [8.4] Updated WITH clause patch (non-recursive)  (Neil Conway <neilc@samurai.com>)
Список pgsql-patches
Neil Conway wrote:
> On Sun, 2008-01-27 at 12:36 -0500, Tom Lane wrote:
>> Both of the above arguments hold water only if we implement
>> compatible *semantics*, not merely syntax, so I find them
>> unconvincing at this stage.
>
> How are the semantics of the proposed patch incompatible with the SQL
>  spec or the implementations in other systems? The proposed patch is
> a *subset* of the functionality in the SQL spec, but it isn't
> incompatible with it as far as I know (recursive and non-recursive
> WITH are distinct features).

An implementation of WITH that inlines the subquery instead of executing
it only once (if appropriate) might not be incompatible with the SQL
spec, but it might very well turn out to be incompatible with other
major DBMSes from a practical point of view. If people use non-recursive
WITH as a replacement for constructs like
CREATE TEMPORARY TABLE temp AS SELECT ... ;
SELECT ... FROM temp, ... ;
, and not merely to increase readability, they won't gain anything from
an inlining WITH implementation.

This, BTW, is the reason that the C++ standard specifies the runtime
complexity (in big-O-notation) for things like vector/list/hash lookups,
instead of just specifying the interface.

regards, Florian Pflug


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

Предыдущее
От: "Dave Page"
Дата:
Сообщение: Re: WIP: plpgsql source code obfuscation
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: WIP: plpgsql source code obfuscation