Looks like it's not sql issue, manually running still use prepared statements
and use same sql plan.
-Original Message-
From: Andreas Kretschmer
Sent: Friday, November 17, 2023 5:17 PM
To: pgsql-performance@lists.postgresql.org
Subject: Re: simple query running long time within a long
Any statement will run using a custom plan at first.
Only a prepared statement creates the memory area in the backend that can hold
the custom plan statistics, that is why generic plans only work with prepared
statements.
A prepared statement has to run at least 5 times before the planner looks a