From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Merlin Moncure <mmoncure(at)gmail(dot)com> |
Cc: | Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Marko Tiikkaja <marko(at)joh(dot)to> |
Subject: | Re: merging some features from plpgsql2 project |
Date: | 2017-01-04 19:00:24 |
Message-ID: | CAFj8pRD641ZLpymw2UneA1UFggaAux4twEdVeVjnj41Yc1sqpQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>
>
>>
>> >>
>> >> >> *) Some user visible mechanic other than forcing SQL through EXECUTE
>> >> >> to be able to control plan caching would be useful.
>> >> >
>> >> > fully agree.
>> >> >
>> >> > Have you some ideas?
>> >> >
>> >> > What about plpgsql option (function scope) -- WITHOUT-PLAN-CACHE -
>> any
>> >> > non
>> >> > trivial plans will not be cached - and evaluated as parametrized
>> query
>> >> > only.
>> >>
>> >> I have slight preference for syntax marker for each query, similar to
>> >> INTO. Maybe 'UNCACHED'?
>> >
>> >
>> > I am not clean opinion - the statement level is nice, but what
>> readability?
>> >
>> > SELECT UNCACHED t.a, t.b FROM INTO a,b;
>>
>> Yeah -- this is pretty ugly admittedly. Maybe control directive is
>> ok, as long as you can set it mid function?
>>
>
> ADA uses for this purpose PRAGMA keyword - it is used for everything in
> ADA - cycle iteration optimization, ...the scope can be statement, block,
> procedure.
>
> so something like
>
> BEGIN
> PRAGMA uncached_plans;
> SELECT ...
> ..
> END;
>
> But it should be verified by some PL/SQL or Ada experts
>
Little bit better - if PRAGMA is used in DECLARE part, then it has block
scope
so some possible design can be:
DECLARE
PRAGMA UNCACHED_PLANS;
BEGIN
SELECT ... INTO ;
SELECT ... INTO ;
END;
This respects Ada and PL/SQL style - probably easy implementation
Regards
Pavel
>
> Regards
>
>
>
>
>
>>
>> merlin
>>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | David Fetter | 2017-01-04 19:04:07 | Re: pgsql: Update copyright for 2017 |
Previous Message | Fabien COELHO | 2017-01-04 18:56:19 | Re: proposal: session server side variables |