Re: Fwd: Planning time is time-consuming

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Mikhail Balayan <mv(dot)balayan(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org, Anupam b <abordia99(at)hotmail(dot)com>
Subject: Re: Fwd: Planning time is time-consuming
Date: 2023-09-11 08:13:26
Message-ID: b5341fc8036b969c90106a26e78b195c5cf07e34.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, 2023-09-11 at 12:57 +0800, Mikhail Balayan wrote:
> Thanks for the idea. I was surprised to find that this is not the way it works and the planning time remains the same.

To benefit from the speed gains of a prepared statement, you'd have to execute it
at least seven times. If a generic plan is used (which should happen), you will
see $1 instead of the literal argument in the execution plan.

Prepared statements are probably your best bet.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message David Rowley 2023-09-11 08:24:35 Re: Planning time is time-consuming
Previous Message Mikhail Balayan 2023-09-11 04:57:20 Fwd: Planning time is time-consuming