Re: [doc] plan invalidation when statistics are update - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: [doc] plan invalidation when statistics are update
Date
Msg-id 1b2c0896-9315-bab8-22a3-6cd1f472ae1a@oss.nttdata.com
Whole thread Raw
In response to [doc] plan invalidation when statistics are update  (torikoshia <torikoshia@oss.nttdata.com>)
Responses Re: [doc] plan invalidation when statistics are update  (torikoshia <torikoshia@oss.nttdata.com>)
List pgsql-hackers

On 2020/11/18 11:04, torikoshia wrote:
> Hi,
> 
> AFAIU, when the planner statistics are updated, generic plans are invalidated and PostgreSQL recreates. However, the
manualdoesn't seem to explain it explicitly.
 
> 
>    https://www.postgresql.org/docs/devel/sql-prepare.html
> 
> I guess this case is included in 'whenever database objects used in the statement have definitional (DDL) changes
undergone',but I feel it's hard to infer.
 
> 
> Since updates of the statistics can often happen, how about describing this case explicitly like an attached patch?

+1 to add that note.

-   statement.  Also, if the value of <xref linkend="guc-search-path"/> changes
+   statement. For example, when the planner statistics of the statement
+   are updated, <productname>PostgreSQL</productname> re-analyzes and
+   re-plans the statement.

I don't think "For example," is necessary.

"planner statistics of the statement" sounds vague? Does the statement
is re-analyzed and re-planned only when the planner statistics of database
objects used in the statement are updated? If yes, we should describe
that to make the note a bit more explicitly?

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Next
From: "kuroda.hayato@fujitsu.com"
Date:
Subject: RE: Terminate the idle sessions