Re: Fwd: Planning time is time-consuming - Mailing list pgsql-performance

From Laurenz Albe
Subject Re: Fwd: Planning time is time-consuming
Date
Msg-id b5341fc8036b969c90106a26e78b195c5cf07e34.camel@cybertec.at
Whole thread Raw
In response to Fwd: Planning time is time-consuming  (Mikhail Balayan <mv.balayan@gmail.com>)
Responses Re: Planning time is time-consuming  (Frits Hoogland <frits.hoogland@gmail.com>)
List 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



pgsql-performance by date:

Previous
From: Mikhail Balayan
Date:
Subject: Fwd: Planning time is time-consuming
Next
From: David Rowley
Date:
Subject: Re: Planning time is time-consuming