public inbox for [email protected]
help / color / mirror / Atom feedRe: documentation question regarding REFRESH MATERIALIZED VIEW CONCURRENTLY
2+ messages / 2 participants
[nested] [flat]
* Re: documentation question regarding REFRESH MATERIALIZED VIEW CONCURRENTLY
@ 2025-02-23 15:21 Greg Sabino Mullane <[email protected]>
2025-02-23 15:34 ` Re: documentation question regarding REFRESH MATERIALIZED VIEW CONCURRENTLY Tobias McNulty <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Greg Sabino Mullane @ 2025-02-23 15:21 UTC (permalink / raw)
To: Tobias McNulty <[email protected]>; +Cc: [email protected]
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: documentation question regarding REFRESH MATERIALIZED VIEW CONCURRENTLY
2025-02-23 15:21 Re: documentation question regarding REFRESH MATERIALIZED VIEW CONCURRENTLY Greg Sabino Mullane <[email protected]>
@ 2025-02-23 15:34 ` Tobias McNulty <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Tobias McNulty @ 2025-02-23 15:34 UTC (permalink / raw)
To: Greg Sabino Mullane <[email protected]>; +Cc: [email protected]
On Sun, Feb 23, 2025 at 10:21 AM Greg Sabino Mullane <[email protected]> wrote:
> 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.
This makes sense to me. Many thanks.
Cheers,
Tobias
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-02-23 15:34 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-02-23 15:21 Re: documentation question regarding REFRESH MATERIALIZED VIEW CONCURRENTLY Greg Sabino Mullane <[email protected]>
2025-02-23 15:34 ` Tobias McNulty <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox