Hi, 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). It will be useful for the user to know what exactly is being planned and executed as part of RMV. Please note that we already have explain/explain analyze CTAS/Create Mat View(CMV), where we show the explain/explain analyze of the select part. This proposal will do the same thing.
The behaviour can be like this: EXPLAIN REFRESH MATERIALIZED VIEW mv1; --> will not refresh the mat view, but shows the select part's plan of mat view. EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW mv1; --> will refresh the mat view and shows the select part's plan of mat view. Thoughts? If okay, I will post a patch later. With Regards, Bharath Rupireddy. EnterpriseDB: http://www.enterprisedb.com