Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW
Date: 2021-03-15 19:45:38
Message-ID: 3058977.1615837538@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[ Sorry for not looking at this thread sooner ]

Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> writes:
> Currently, $subject is not allowed. We do plan the mat view query
> before every refresh. I propose to show the explain/explain analyze of
> the select part of the mat view in case of Refresh Mat View(RMV).

TBH, I think we should reject this. The problem with it is that it
binds us to the assumption that REFRESH MATERIALIZED VIEW has an
explainable plan. There are various people poking at ideas like
incremental matview updates, which might rely on some implementation
that doesn't exactly equate to a SQL query. Incremental updates are
hard enough already; they'll be even harder if they also have to
maintain compatibility with a pre-existing EXPLAIN behavior.

I don't really see that this feature buys us anything you can't
get by explaining the view's query, so I think we're better advised
to keep our options open about how REFRESH might be implemented
in future.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-03-15 19:47:25 Re: [HACKERS] PATCH: Batch/pipelining support for libpq
Previous Message Julien Rouhaud 2021-03-15 19:37:03 Re: REINDEX backend filtering