Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-06 Thread Jeff Davis
On Tue, 2024-08-06 at 14:36 -0400, Tom Lane wrote: > I'm not really sure I see the point of this, if it doesn't "just > work" > with all variants of C.M.V.  It's not like you can't easily EXPLAIN > the view's SELECT. > > If REFRESH M. V. does something different than CREATE, there would > certainl

Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-06 Thread Yugo NAGATA
On Tue, 06 Aug 2024 11:24:03 -0700 Jeff Davis wrote: > On Wed, 2024-08-07 at 03:06 +0900, Yugo Nagata wrote: > > I'm sorry. After sending the mail, I found the patch didn't work. > > If we call RestrictSearchPath() before creating a relation, it tries > > to create the relation in pg_catalog and

Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-06 Thread Tom Lane
Jeff Davis writes: > As you point out in the other email, it's not easy to make that all > work with REFRESH ... CONCURRENTLY, but perhaps it could work with > CREATE MATERIALIZED VIEW and REFRESH (without CONCURRENTLY). I'm not really sure I see the point of this, if it doesn't "just work" with

Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-06 Thread Jeff Davis
On Wed, 2024-08-07 at 03:06 +0900, Yugo Nagata wrote: > I'm sorry. After sending the mail, I found the patch didn't work. > If we call RestrictSearchPath() before creating a relation, it tries > to create the relation in pg_catalog and it causes an error. Yeah, that's exactly the problem I ran int

Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-06 Thread Yugo Nagata
On Wed, 7 Aug 2024 02:13:04 +0900 Yugo Nagata wrote: > On Thu, 01 Aug 2024 13:34:51 -0700 > Jeff Davis wrote: > > > On Fri, 2024-08-02 at 00:13 +0500, Kirill Reshke wrote: > > > On Thu, 1 Aug 2024 at 23:27, Jeff Davis wrote: > > > > > > > > EXPLAIN ANALYZE CREATE MATERIALIZED VIEW doesn't go

Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-06 Thread Kirill Reshke
On Tue, 6 Aug 2024 at 22:13, Yugo Nagata wrote: > > On Thu, 01 Aug 2024 13:34:51 -0700 > Jeff Davis wrote: > > > On Fri, 2024-08-02 at 00:13 +0500, Kirill Reshke wrote: > > > On Thu, 1 Aug 2024 at 23:27, Jeff Davis wrote: > > > > > > > > EXPLAIN ANALYZE CREATE MATERIALIZED VIEW doesn't go throug

Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-06 Thread Yugo Nagata
On Thu, 01 Aug 2024 13:34:51 -0700 Jeff Davis wrote: > On Fri, 2024-08-02 at 00:13 +0500, Kirill Reshke wrote: > > On Thu, 1 Aug 2024 at 23:27, Jeff Davis wrote: > > > > > > EXPLAIN ANALYZE CREATE MATERIALIZED VIEW doesn't go through > > > ExecCreateTableAs(), but does use CreateIntoRelDestRece

Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-06 Thread Kirill Reshke
On Tue, 6 Aug 2024 at 21:06, Yugo Nagata wrote: > > On Thu, 1 Aug 2024 23:41:18 +0500 > Kirill Reshke wrote: > > > On Thu, 1 Aug 2024 at 23:27, Jeff Davis wrote: > > > Relatedly, if we can EXPLAIN a CREATE MATERIALIZED VIEW, perhaps we > > > should be able to EXPLAIN a REFRESH MATERIALIZED VIEW,

Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-06 Thread Yugo Nagata
On Thu, 1 Aug 2024 23:41:18 +0500 Kirill Reshke wrote: > On Thu, 1 Aug 2024 at 23:27, Jeff Davis wrote: > > Relatedly, if we can EXPLAIN a CREATE MATERIALIZED VIEW, perhaps we > > should be able to EXPLAIN a REFRESH MATERIALIZED VIEW, too? > Sure REFRESH MATERIALIZED VIEW consists of not only t

Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-01 Thread Jeff Davis
On Fri, 2024-08-02 at 00:13 +0500, Kirill Reshke wrote: > On Thu, 1 Aug 2024 at 23:27, Jeff Davis wrote: > > > > EXPLAIN ANALYZE CREATE MATERIALIZED VIEW doesn't go through > > ExecCreateTableAs(), but does use CreateIntoRelDestReceiver(). > > EXPLAIN ANALYZE and regular query goes through creat

Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-01 Thread Kirill Reshke
On Thu, 1 Aug 2024 at 23:27, Jeff Davis wrote: > > EXPLAIN ANALYZE CREATE MATERIALIZED VIEW doesn't go through > ExecCreateTableAs(), but does use CreateIntoRelDestReceiver(). EXPLAIN ANALYZE and regular query goes through create_ctas_internal (WITH NO DATA case too). Maybe we can simply move Set

Re: Inconsistency with EXPLAIN ANALYZE CREATE MATERIALIZED VIEW

2024-08-01 Thread Kirill Reshke
On Thu, 1 Aug 2024 at 23:27, Jeff Davis wrote: > Relatedly, if we can EXPLAIN a CREATE MATERIALIZED VIEW, perhaps we > should be able to EXPLAIN a REFRESH MATERIALIZED VIEW, too? Sure > Comments? Seems like this is indeed inconsistent behaviour and should be fixed in all PGDG-supported versions i