Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iEypp-0007bR-B0 for pgsql-docs@arkaria.postgresql.org; Mon, 30 Sep 2019 16:47:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iEypo-0001bg-3L for pgsql-docs@arkaria.postgresql.org; Mon, 30 Sep 2019 16:47:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iEypn-0001bV-SO for pgsql-docs@lists.postgresql.org; Mon, 30 Sep 2019 16:47:39 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iEypl-0006Bn-3n for pgsql-docs@postgresql.org; Mon, 30 Sep 2019 16:47:39 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1iEypi-0004S2-QA; Mon, 30 Sep 2019 12:47:34 -0400 Date: Mon, 30 Sep 2019 12:47:34 -0400 From: Bruce Momjian To: Tom Lane Cc: PostgreSQL-documentation Subject: Re: PREPARE and GUC plan_cache_mode Message-ID: <20190930164734.GD8385@momjian.us> References: <20190930155505.GA21095@momjian.us> <13155.1569859507@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13155.1569859507@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Sep 30, 2019 at 12:05:07PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > Our current docs have this text for PREPARE: > > Prepared statements can use generic plans rather than re-planning > > with each set of supplied EXECUTE values. This occurs immediately > > for prepared statements with no parameters; otherwise it occurs > > only after five or more executions produce plans whose estimated > > cost average (including planning overhead) is more expensive than > > the generic plan cost estimate. Once a generic plan is chosen, it > > is used for the remaining lifetime of the prepared statement. Using > > EXECUTE values which are rare in columns with many duplicates can > > generate custom plans that are so much cheaper than the generic > > plan, even after adding planning overhead, that the generic plan > > might never be used. > > > There is no mention that PG 12's plan_cache_mode can modify this > > behavior. I think this needs a doc patch. > > Yeah, agreed. I can do it, or do you want to? Uh, I am feeling I can't do anything with the tree until Friday because of the PG 12 packaging, right? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +