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.96) (envelope-from ) id 1wJy3H-000SBo-0k for pgsql-hackers@arkaria.postgresql.org; Mon, 04 May 2026 18:29:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wJy3F-008OJ1-10 for pgsql-hackers@arkaria.postgresql.org; Mon, 04 May 2026 18:29:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wJy3F-008OIm-03 for pgsql-hackers@lists.postgresql.org; Mon, 04 May 2026 18:29:53 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wJy3C-00000000BVD-3Vmz for pgsql-hackers@lists.postgresql.org; Mon, 04 May 2026 18:29:52 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-7de4be15125so3879817a34.0 for ; Mon, 04 May 2026 11:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777919391; x=1778524191; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=04nb2vc8qQ1QDYxteZbE5Oycc0fuC+VnV3WyIlG7IoQ=; b=o4TN6/CgyYosrM8KRgVHwe8oQqujuHUFzpbMrjexvD7Yp8bIwtKCT28iG0sAMGt5TG u5VxKskEFAJT1EbxSjg5lYDjMeZoiOEmTJVcOrmhdW1e0U1G/AHfX8N3vL65l0aZ9Fje YkBoyM1mMt39ItmK7w7QghwyJBHfJh2rtw1ZlDQtJ7oFez8/SsBeuK/lbIULSN09bRhC XtEMbH4r7MVZvloMQT/nny2BAm3utcznA6IQ4NJelCQHbdk5OKLRcSSDzW4RKHt06PXM acUroiHtVRJTJ222GEbv0XKeCY65erJI85f/52A9CGutpe/3KDqXCrSTMy0rjWxlyMOK FJcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777919391; x=1778524191; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=04nb2vc8qQ1QDYxteZbE5Oycc0fuC+VnV3WyIlG7IoQ=; b=lt82Z0r9ODxMP4J1ploNLLRs1gXpM7Mz6V8drTpiYEihWdL1kRB1hpMBjK5HL6Gse/ IRXPxcHhyLf0sgjMSdJLy0CdISCZozDOU6W1NN7cZfklruG6YB9PqSXcLbPewrjNWzuM 5RDT8XTFAwvpA7rdV4v6nVVh8GryKeICQndOFDbyHuzNKeJwuDZXfGwqePZWa12YU2th g14pDzl4wBpt3rcsgo0Dh04pCWSgFZKxzJWnEiLpo8mcNNofJ7dqZgfaWh1dDsW7NyyZ IWRJu9aYX097K5p3CHg4rkt6IlQWnFM6JLinxpVw3SKfjt1/wUpE2qrg6oGc6NCwBdWu ukMA== X-Forwarded-Encrypted: i=1; AFNElJ85h2F7I0pIl2Y9qYmSs8nQPIAmXV2jhXJNhfE03NR7mbPBNVJSPq2v0/i8obSSLwAP7D0dIlqhtkqai5rD@lists.postgresql.org X-Gm-Message-State: AOJu0Yzw/itnr3pwAkaZ6MHlt1VRp2b11/BoaTyCTJtGKY+ZJba4pH0I NaymoURbqfaHsnXJzAAOPejShuaXjN/4jHMdbOVlSrqecSnheYf/0Vg8 X-Gm-Gg: AeBDiesP3hSkl0w40LZuSXy1mJNth8Ht5wEffisWT98PrL1a1xOA4MENtKXHGmmzE64 Qf5XoTHJWXwl2Cuqoi39s2JLvJfcaSMv9SKu6ScUCnMtqSq6WXmSp1Ue22Hen772XGwUDKlTCLF bC6gH14oR1EZqg76YtFEL2Vtz8dGOXqbWOuvUC/zJMyd9hUO0GbYl+eCBBUhwGJfirbATebBZg1 XZHcQOt0S1hWs+3V3U52iGe8zE3Y5SeVwGuX8sy9E2Yqs8suxjiK2a+da3p39ZmioQ/Jb+uuyYq HDfmJdzwfhYhqBeIreqa4TBN/isDDkJJn/IRZjMK8IRYmv70Drtuxtq4RSZpjeBLTAB897oEraO pSlUNUBrqK4CKRHpXIuoF5njmM1luIJ5UV+QS6KzW7MXWqoJftQARyeTPJlJr3hOKoFi7dWkiwt sq5DOnF+e/baOb6kK7Tyl/1meQt0s93Hta9RazEd3SI8tH8SPskN6L3RalbO8Zi4PLGnDO60/cm VtX2w== X-Received: by 2002:a05:6830:82b9:b0:7dc:dd58:50ab with SMTP id 46e09a7af769-7dee1431876mr6430749a34.14.1777919390760; Mon, 04 May 2026 11:29:50 -0700 (PDT) Received: from [172.31.5.233] (vip-148-139-2-229.cust.service-now.com. [148.139.2.229]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7decac26330sm8283347a34.13.2026.05.04.11.29.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 May 2026 11:29:50 -0700 (PDT) Message-ID: <4172933b-dc7c-4fce-8ea1-154cf4864511@gmail.com> Date: Mon, 4 May 2026 20:29:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Avoid calling SetMatViewPopulatedState if possible To: cca5507 , pgsql-hackers References: Content-Language: en-US From: David Geier In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 10.04.2026 05:36, cca5507 wrote: > During refresh matview, we call SetMatViewPopulatedState unconditionally even > if the value doesn't change. Attach a small patch to optimize it. Thanks for sharing this patch. While being a simple patch, it would be good to know what actual use cases this change improves on and by how much. Can you share a test case and/or performance data? -- David Geier