pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Zahir Lalani <ZahirLalani@oliver.agency>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Mat Views and Conflicts
Date: Tue, 20 Feb 2024 08:13:21 -0800
Message-ID: <d68d556d-c124-40f9-8879-47b9e75be2e1@aklaver.com> (raw)
In-Reply-To: <AS8P251MB01208F555627AE1C46CE0C66A7502@AS8P251MB0120.EURP251.PROD.OUTLOOK.COM>
References: <AS8P251MB012075726CD81F97C586842CA7512@AS8P251MB0120.EURP251.PROD.OUTLOOK.COM>
	<c02bdeda-9ffb-42a5-8b6d-c13b9380f0fe@aklaver.com>
	<AS8P251MB01207A05FECF749D81ABC5DDA7502@AS8P251MB0120.EURP251.PROD.OUTLOOK.COM>
	<CAKFQuwb-aUnZ6u_56b-+ZoOkeZij3WocXAqACPreqBsU_Eq+tg@mail.gmail.com>
	<AS8P251MB01208F555627AE1C46CE0C66A7502@AS8P251MB0120.EURP251.PROD.OUTLOOK.COM>

On 2/20/24 05:25, Zahir Lalani wrote:
> -From: David G. Johnston <david.g.johnston@gmail.com>
> -Sent: Tuesday, February 20, 2024 1:20 PM
> -To: Zahir Lalani <ZahirLalani@oliver.agency>
> -Cc: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general@lists.postgresql.org
> -Subject: Re: Mat Views and Conflicts
> -
> -
> -On Tuesday, February 20, 2024, Zahir Lalani <mailto:ZahirLalani@oliver.agency> wrote:
> -
> -This suggests that not all the MV data is cached and it still queries the source tables in some way?
> -
> -No.  That isn’t how MV work.  If you include an MV relation in your query from clause there is no reference or knowledge as to the underlying query that built the MV physical relation.
> -
> -David J.
> 
> Thx David
> 
> Cool so that is what my understanding was. But that comes back to my main question - the MV is cached data from the last time refresh was run. If I query the MV and the underlying realtime data changes (i.e. from the source tables not the MV)  - should I be getting a replication conflict issue? I would have thought not as the MV data should not have been impacted

Then either something is running REFRESH MATERIALIZED VIEW or some other 
process is accessing the underlying tables.

> 
> Z

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (8+ messages)

Message-ID: <d68d556d-c124-40f9-8879-47b9e75be2e1@aklaver.com>
Permalink:  ../d68d556d-c124-40f9-8879-47b9e75be2e1@aklaver.com/
Also on:    postgresql.org/message-id/d68d556d-c124-40f9-8879-47b9e75be2e1@aklaver.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, ZahirLalani@oliver.agency, david.g.johnston@gmail.com
  Subject: Re: Mat Views and Conflicts
  In-Reply-To: <d68d556d-c124-40f9-8879-47b9e75be2e1@aklaver.com>
  References: <AS8P251MB012075726CD81F97C586842CA7512@AS8P251MB0120.EURP251.PROD.OUTLOOK.COM> <c02bdeda-9ffb-42a5-8b6d-c13b9380f0fe@aklaver.com> <AS8P251MB01207A05FECF749D81ABC5DDA7502@AS8P251MB0120.EURP251.PROD.OUTLOOK.COM> <CAKFQuwb-aUnZ6u_56b-+ZoOkeZij3WocXAqACPreqBsU_Eq+tg@mail.gmail.com> <AS8P251MB01208F555627AE1C46CE0C66A7502@AS8P251MB0120.EURP251.PROD.OUTLOOK.COM> <d68d556d-c124-40f9-8879-47b9e75be2e1@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox