Search Postgresql Archives

Re: How to observe plan_cache_mode transition from custom to generic plan?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2021-09-06 at 03:07 -0400, Mladen Gogala wrote:
> 
> On 9/6/21 2:26 AM, Laurenz Albe wrote:
> > "Bind variables" just being an Oraclism for parameters, it is*not*  a
> > mistake to use them in PostgreSQL.
> 
> Actually, it is a mistake because they don't give you any performance 
> benefit and can potentially worsen the performance. There is no cursor 
> sharing and generic plans can be much worse than "custom" plans, 
> generated with the actual values. The only reason for using bind 
> variables/parameters is to protect yourself from SQL injection.

I disagree.  There is defnitely a performance benefit in not generating
a plan for each execution, even if plans are only cached per session.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux