Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcSkM-000GVL-Tc for pgsql-general@arkaria.postgresql.org; Tue, 20 Feb 2024 16:13:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rcSkK-000jtT-Ho for pgsql-general@arkaria.postgresql.org; Tue, 20 Feb 2024 16:13:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcSkK-000jtK-7A for pgsql-general@lists.postgresql.org; Tue, 20 Feb 2024 16:13:28 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcSkI-0001xE-35 for pgsql-general@lists.postgresql.org; Tue, 20 Feb 2024 16:13:28 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 58F4532009FA; Tue, 20 Feb 2024 11:13:23 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 20 Feb 2024 11:13:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1708445602; x=1708532002; bh=hThj+Eie4nFVFnkgy6U0Vc7ErX5fadOKXGyC35eAoOs=; b= PooOxpEbwlmHWCrX/tQ9t1X6mSR8l8qr6oHVHfLHB65SMX1BabrY+TAYvTso+Z7V jo4sNdW1jxMVm9+buVS6LhuBM4oGkCC+pKvUtGE82SNtncLfdvGC2b21CLndIsfj /qi8cwN+LtkzF4zJOrj900cEHNYTgw0bVF3966/1i1Rzoz7+g5NAF6eep24voACX HYWP/apnN0YWSX6OCfLO/8ZtOrdYL4VWdXpi+I8Hp5tfaQo/QJ/UVD0DyHX+o6Wj mByPdNgvXidrARj0y+RhHuSulxW7cwCLw79zm+DLsyBZqQ5qmhhk8LNQEWVe2zwC l/ZQRaT9bP3WTNUwwFHAlA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1708445602; x= 1708532002; bh=hThj+Eie4nFVFnkgy6U0Vc7ErX5fadOKXGyC35eAoOs=; b=N W40YNgLQgLBY4zEZ/4eks4dkpXQRJBdup1z8QN40ezTXs2px32uDMgEcyJZ8Y7Bo PrCOMUvEWvaf2aR5qCZe1KpU9YdHV+3uZmRVU+CNLTx+r/ALS9NfU2r64fd+7jes 8fVzu4cehDTiVPJUaISBmrXx4VMTIL7aVv2IsUDls5nrqfd3inxuwDJLWIZHfeJv u0+Z0irjLxynr+qocnymYpW7UrTpPTs7FcS9q28t/0Sjbd726ym7thQdxmqg/PX8 cwNlEM87PruEdtwFBNyVfIbLr09ln5rC4igVK2T//ISX+F+BiMF2gjBWvfLWnp99 u7Lwp9YLDOSDkLf9ceGoQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeefgeefieeutdfggfetgefgheekjeehteeileeigfet ieekjedvieeviefgheevtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Feb 2024 11:13:22 -0500 (EST) Message-ID: Date: Tue, 20 Feb 2024 08:13:21 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Mat Views and Conflicts Content-Language: en-US To: Zahir Lalani , "David G. Johnston" Cc: "pgsql-general@lists.postgresql.org" References: From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/20/24 05:25, Zahir Lalani wrote: > -From: David G. Johnston > -Sent: Tuesday, February 20, 2024 1:20 PM > -To: Zahir Lalani > -Cc: Adrian Klaver ; pgsql-general@lists.postgresql.org > -Subject: Re: Mat Views and Conflicts > - > - > -On Tuesday, February 20, 2024, Zahir Lalani 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