public inbox for [email protected]
help / color / mirror / Atom feedFrom: Greg Sabino Mullane <[email protected]>
To: Tobias McNulty <[email protected]>
Cc: [email protected]
Subject: Re: documentation question regarding REFRESH MATERIALIZED VIEW CONCURRENTLY
Date: Sun, 23 Feb 2025 10:21:14 -0500
Message-ID: <CAKAnmm+14y_3HyHOcZwcHkqAvmZedXLSm97uVZHVr8eWg__W+Q@mail.gmail.com> (raw)
In-Reply-To: <CAMGFDKTW+SgLgdqRNa4cx9x1rFbA=2_8SE51r30A8o+9N2ikpA@mail.gmail.com>
References: <CAMGFDKTW+SgLgdqRNa4cx9x1rFbA=2_8SE51r30A8o+9N2ikpA@mail.gmail.com>
On Sat, Feb 22, 2025 at 8:58 PM Tobias McNulty <[email protected]>
wrote:
> "Without this option a refresh which affects a lot of rows will tend to
> use fewer resources"
...
> either that (1) the refresh operation actually updates the contents of a
> lot of rows in the materialized view
This is the correct interpretation. A regular refresh simply runs the query
and replaces the old view, regardless of the number of rows that have
changed. A concurrent refresh runs the query and updates the rows in place,
so it is very sensitive as to how many of those rows have changed. This
also means that many concurrent refreshes can lead to table bloat. And it
will generate more WAL than a regular refresh.
My takeaway: use regular refresh when you can. Switch to concurrent if the
number of changes is very small, or if constant client access to the view
is very important.
--
Cheers,
Greg
--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: documentation question regarding REFRESH MATERIALIZED VIEW CONCURRENTLY
In-Reply-To: <CAKAnmm+14y_3HyHOcZwcHkqAvmZedXLSm97uVZHVr8eWg__W+Q@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox