Re: plan cache overhead on plpgsql expression - Mailing list pgsql-hackers

From Tom Lane
Subject Re: plan cache overhead on plpgsql expression
Date
Msg-id 21557.1585244392@sss.pgh.pa.us
Whole thread Raw
In response to Re: plan cache overhead on plpgsql expression  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: plan cache overhead on plpgsql expression  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Amit Langote <amitlangote09@gmail.com> writes:
> One thing -- I don't get the division between
> CachedPlanAllowsSimpleValidityCheck() and CachedPlanIsSimplyValid().
> Maybe I am missing something, but could there not be just one
> function, possibly using whether expr_simple_expr is set or not to
> skip or do, resp., the checks that the former does?

Well, we don't want to do the initial checks over again every time;
we want the is-valid test to be as simple and fast as we can make it.
I suppose we could have one function with a boolean flag saying "this is a
recheck", but I don't find that idea to be any better than the way it is.

Also, although the existing structure in plpgsql always calls
CachedPlanIsSimplyValid immediately after a successful call to
CachedPlanAllowsSimpleValidityCheck, I don't think that's necessarily
going to be true for other potential users of the functions.
So merging the functions would reduce flexibility.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: A bug when use get_bit() function for a long bytea string
Next
From: Mark Dilger
Date:
Subject: Re: backup manifests