Re: [HACKERS] mat views stats - Mailing list pgsql-hackers

From Jim Mlodgenski
Subject Re: [HACKERS] mat views stats
Date
Msg-id CAB_5SRds3h_pgsS=EBv0S8fX5je0yHJQW7MzJh85oV4XdzHhvQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] mat views stats  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] mat views stats  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers


On Sun, Feb 26, 2017 at 11:49 AM, Robert Haas <robertmhaas@gmail.com> wrote:
On Wed, Feb 22, 2017 at 11:13 AM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
> Certainly easier, but I don't think it'd be better. Matviews really aren't
> the same thing as tables. Off-hand (without reviewing the patch), update and
> delete counts certainly wouldn't make any sense. "Insert" counts might, in
> as much as it's how many rows have been added by refreshes. You'd want a
> refresh count too.

Regular REFRESH truncates the view and repopulates it, but REFRESH
CONCURRENTLY does inserts, updates, and deletes as needed to adjust
the contents.  So I think all the same counters that make sense for
regular tables are also sensible here.


After digging into things further, just making refresh report the stats for what is it basically doing simplifies and solves it and it is something we can back patch if that the consensus. See the attached patch.


Attachment

pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: [HACKERS] GSoC 2017
Next
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] logical decoding of two-phase transactions