On Fri, Jan 21, 2022 at 9:36 AM Dominique Devienne <ddevienne@xxxxxxxxx> wrote:
for the various cases of empty argN strings, or does the planner do
*bind-peeking*, and thus a single prepared statement would do the job,
and still have different plans used depending on the actual binds?
I'm assuming PostgreSQL does bind-peeking like Oracle, but I don't
know, and I've never read anything yet about that.
A prepared statement either generates a custom plan and, as a side-effect, does bind-peeking, or it uses the single prepared plan it has established and executes that. It doesn't use bind-peeking to decide among multiple saved prepared plans. There is more to it than that, like a 5 custom plan threshold before abandoning bind-peeking (I think I got that right...).
David J.