On 2020-11-18 11:04, torikoshia wrote:
Hi,


Currently, EXPLAIN is the only way to know whether the plan is generic
or custom according to the manual of PREPARE.

  https://www.postgresql.org/docs/devel/sql-prepare.html

After commit d05b172, we can also use pg_prepared_statements view to
examine the plan types.

How about adding this explanation like the attached patch?

Sorry, but on second thought, since it seems better to add
the explanation to the current description of pg_prepared_statements,
I modified the patch.


Regards,

--
Atsushi Torikoshi
From ec969fa55c2ffc71ce0b94e923e013d650de2220 Mon Sep 17 00:00:00 2001
From: Atsushi Torikoshi <torikos...@oss.nttdata.com>
Date: Thu, 19 Nov 2020 14:45:49 +0900
Subject: [PATCH v2] After commit d05b172, we can use pg_prepared_statements
 view to examine the number of generic and custom were chosen. This patch adds
 this explanation in the manual of PREPARE.

---
 doc/src/sgml/ref/prepare.sgml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/prepare.sgml b/doc/src/sgml/ref/prepare.sgml
index 57a34ff83c..3cc5f9de4a 100644
--- a/doc/src/sgml/ref/prepare.sgml
+++ b/doc/src/sgml/ref/prepare.sgml
@@ -204,7 +204,8 @@ EXPLAIN EXECUTE <replaceable>name</replaceable>(<replaceable>parameter_values</r
   <para>
    You can see all prepared statements available in the session by querying the
    <link linkend="view-pg-prepared-statements"><structname>pg_prepared_statements</structname></link>
-   system view.
+   system view. This view also shows the numbers of generic and custom plans
+   were chosen.
   </para>
  </refsect1>
 
-- 
2.18.1

Reply via email to