Re: Make EXPLAIN generate a generic plan for a parameterized query - Mailing list pgsql-hackers

From Michel Pelletier
Subject Re: Make EXPLAIN generate a generic plan for a parameterized query
Date
Msg-id CACxu=vKjLyV4HZjtEoUpXMdRDKdF9D6_VWxyNoTwXd0tLAmK=A@mail.gmail.com
Whole thread Raw
In response to Re: Make EXPLAIN generate a generic plan for a parameterized query  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Make EXPLAIN generate a generic plan for a parameterized query  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-hackers
On Wed, Dec 7, 2022 at 3:23 AM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Tue, 2022-12-06 at 10:17 -0800, Andres Freund wrote:
> On 2022-10-29 10:35:26 +0200, Laurenz Albe wrote:
> > > > Here is a patch that
> > > > implements it with an EXPLAIN option named GENERIC_PLAN.
>
> This fails to build the docs:
>
> https://cirrus-ci.com/task/5609301511766016
>
> [17:47:01.064] ref/explain.sgml:179: parser error : Opening and ending tag mismatch: likeral line 179 and literal
> [17:47:01.064]       <likeral>ANALYZE</literal>, since a statement with unknown parameters
> [17:47:01.064]                                 ^

*blush* Here is a fixed version.

I built and tested this patch for review and it works well, although I got the following warning when building:

analyze.c: In function 'transformStmt':
analyze.c:2919:35: warning: 'generic_plan' may be used uninitialized in this function [-Wmaybe-uninitialized]
 2919 |         pstate->p_generic_explain = generic_plan;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
analyze.c:2909:25: note: 'generic_plan' was declared here
 2909 |         bool            generic_plan;
      |                         ^~~~~~~~~~~~

pgsql-hackers by date:

Previous
From: Zheng Li
Date:
Subject: Re: Support logical replication of DDLs
Next
From: Andres Freund
Date:
Subject: Re: recovery modules