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 1tmE09-0054zw-KF for pgsql-general@arkaria.postgresql.org; Sun, 23 Feb 2025 15:34:42 +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 1tmE08-00BAVA-6S for pgsql-general@arkaria.postgresql.org; Sun, 23 Feb 2025 15:34:40 +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.94.2) (envelope-from ) id 1tmE07-00BAV2-Ql for pgsql-general@lists.postgresql.org; Sun, 23 Feb 2025 15:34:39 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tmE04-000JpH-1t for pgsql-general@lists.postgresql.org; Sun, 23 Feb 2025 15:34:38 +0000 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3f41706d768so2303267b6e.1 for ; Sun, 23 Feb 2025 07:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=caktusgroup.com; s=google; t=1740324877; x=1740929677; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NGSsRo8qeA1N8ZVdvW/5iFC/y6qA7AQ+lStF8xGvBhc=; b=dkXk1uY5IowQzPNOZtMXb3TMArnZ3WfptO4bVL0kcYbf6Ui4LSJekUYgbHQaTAXzYz G8R2nYX4b76Cl6SO5eWw/hb24nS8ymFIAd88tjWz1Eboe8Yv5DWa2U7nH9XFonmFAeFj +9ngyJXR1v8MaO2jJTrr0AycifoqtiOCZE3NLsOKpDqPRbtOgkqaeQecfQiHyoJrcl9x DCie15oV0vr1OOdTtnTC9gSyTPo14/f5N4ZvioasSeWAmrfZxmgLwiI6RVgoYpdoc7yI QGe+IoiYmvBN59Mh3RsBXf+2aZGACOleQmHxu7pMbGIcMs+9M5WvOaLKZvWPEeokrxzJ VMLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740324877; x=1740929677; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NGSsRo8qeA1N8ZVdvW/5iFC/y6qA7AQ+lStF8xGvBhc=; b=o5+7/z3X+igPX6jOFkfkJxeGROoNV90pGDQ0lU3TY88QmgWXNdXtm71lJFQRL3WVTx 8gvzQOhNkBni7ex/cJYHVMwXETbhcT6yK0bjiFRPFpa3rN1nfPozJNjB7R0tb1uynzO7 K/drgIOvhSrf610VQ0LKioBqojn3vr5Wgig3qF4Fd4jVPTjqydzLIC8kZfceF3wWSYUI AT9HA7ao7pRsJLS/EomkpWMn7ZtSsnUTXWeLgqzlHfJi4D0vHSZqG8czzuUZNmgMZWsz Cvt/U53oT2jWWI/wvEuZZ854wk5prJczgfUl+ff9MeGWdlnYnWdcyc1buXH/gmxvlqip 8X3w== X-Gm-Message-State: AOJu0YzNz77OfObyyircBgNE1b5GSD4MXB0+ifSuieOLuW82NZlZ1QCJ UUFz/7Z0jE0g3oUaPcjVEkLbd5D1H/Nyc8kHXP7YbGhjY0v2mHnyl3TGSNcvpaStv6UdP1cProM YkQOoyuanloTQP9bgwGTpY0gPjSMDnDSJBHqhLA== X-Gm-Gg: ASbGncvNLQDnAXKr49NnaMm2+0xV3Yyb8i+fbebhpqNZ58FvjFgKBEBYx/jUdshj/KZ E6JYSUrOx/KqtNZ/59HHX62U0TWYVcn8UxP/WVoOTfYL08WLcgaxSCm7RcAkDCYCKhuC13AMnvI TlxMmnSqo= X-Google-Smtp-Source: AGHT+IHkVhuurWyjNJGXN4Vulc02Gx7aoHr02onH07u8eonN54uyU6h75z9y33+Vd/l7+KEZrVgKpUwHD0gG1ciYSi0= X-Received: by 2002:a05:6808:1920:b0:3f3:fe04:f86 with SMTP id 5614622812f47-3f424b040a5mr7212910b6e.0.1740324877030; Sun, 23 Feb 2025 07:34:37 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Tobias McNulty Date: Sun, 23 Feb 2025 10:34:25 -0500 X-Gm-Features: AWEUYZmUoeJMqrkNt8hsCXp4L6586y8JYGnkrXUY2V4dt0_jU40LeEyMVx1iReU Message-ID: Subject: Re: documentation question regarding REFRESH MATERIALIZED VIEW CONCURRENTLY To: Greg Sabino Mullane Cc: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Feb 23, 2025 at 10:21=E2=80=AFAM Greg Sabino Mullane wrote: > This is the correct interpretation. A regular refresh simply runs the que= ry and replaces the old view, regardless of the number of rows that have ch= anged. A concurrent refresh runs the query and updates the rows in place, s= o 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 th= e 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