Re: Generating "Subplan Removed" in EXPLAIN

2023-02-01 Thread Yugo NAGATA
On Wed, 1 Feb 2023 16:52:07 +1300 David Rowley wrote: > On Wed, 1 Feb 2023 at 15:53, Yugo NAGATA wrote: > > Maybe, you missed to set plan_cache_mode to force_generic_plan. > > "Subplan Removed" doesn't appear when using a custom plan. > > I wouldn't say that's 100% true. The planner is only abl

Re: Generating "Subplan Removed" in EXPLAIN

2023-01-31 Thread David Rowley
On Wed, 1 Feb 2023 at 15:53, Yugo NAGATA wrote: > Maybe, you missed to set plan_cache_mode to force_generic_plan. > "Subplan Removed" doesn't appear when using a custom plan. I wouldn't say that's 100% true. The planner is only able to prune using values which are known during planning. Constant

Re: Generating "Subplan Removed" in EXPLAIN

2023-01-31 Thread Bruce Momjian
On Wed, Feb 1, 2023 at 11:53:34AM +0900, Yugo NAGATA wrote: > On Tue, 31 Jan 2023 20:38:21 -0600 > Justin Pryzby wrote: > > > > > To: Bruce Momjian > > Cc: pgsql-hack...@postgresql.org > > Subject: Re: Generating "Subplan Removed" in EXPLAIN > &g

Re: Generating "Subplan Removed" in EXPLAIN

2023-01-31 Thread Yugo NAGATA
On Tue, 31 Jan 2023 20:38:21 -0600 Justin Pryzby wrote: > > To: Bruce Momjian > Cc: pgsql-hack...@postgresql.org > Subject: Re: Generating "Subplan Removed" in EXPLAIN > Date: Tue, 31 Jan 2023 20:38:21 -0600 > User-Agent: Mutt/1.9.4 (2018-02-28) > > On Tue

Re: Generating "Subplan Removed" in EXPLAIN

2023-01-31 Thread Justin Pryzby
On Tue, Jan 31, 2023 at 08:59:57PM -0500, Bruce Momjian wrote: > Does anyone know how to generate this? Thanks. The regression tests know: $ git grep -c 'Subplans Removed' ./src/test/regress/ src/test/regress/expected/partition_prune.out:29 -- Justin

Re: Generating "Subplan Removed" in EXPLAIN

2023-01-31 Thread Bruce Momjian
On Tue, Jan 31, 2023 at 08:59:57PM -0500, Bruce Momjian wrote: > Our document states that EXPLAIN can generate "Subplan Removed": > > > https://www.postgresql.org/docs/current/ddl-partitioning.html#DDL-PARTITION-PRUNING > > It is possible to determine the number of partitions which w

Generating "Subplan Removed" in EXPLAIN

2023-01-31 Thread Bruce Momjian
Our document states that EXPLAIN can generate "Subplan Removed": https://www.postgresql.org/docs/current/ddl-partitioning.html#DDL-PARTITION-PRUNING It is possible to determine the number of partitions which were removed during this phase by observing the “Subplans Remove