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 1w5m3h-003cAN-2X for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 14:51:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5m3g-003JRG-10 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 14:51: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.96) (envelope-from ) id 1w5m3g-003JR7-05 for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 14:51:40 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5m3e-000000019eo-2jcb for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 14:51:39 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-66abcbae8a2so860064a12.3 for ; Thu, 26 Mar 2026 07:51:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774536697; cv=none; d=google.com; s=arc-20240605; b=lmgANVRA+jbpzb9brT3n4qafh/Rq9U5F/KrjyVMF6tO0Vl4sDGTS0VkBv7SDBEiDxk P7iiaoulEbqwOqphI3jdMQc8mYEFzzs5YdLYIXWJzxueAxasKS+24WbAjfeif0NWSSS8 E0SODfF7DGa0MbWNOCf+6f0i+YBxLi00baN0BUlOwyMUR4G4UKC/nccsJ5Dn0ajJ29Qx C4tHVBn58TUzlHkgPJt65UHPdErNZcLCPES9K2dFer5/VQ0vwZL6ChgmSzfS+GUsAIOu 1o6ijm+bG+39Z0WiyiQFuXqIxsAFZwevhODwfVzqFHzVWoEc8+s2BzF3mUrOMZk70j0n sI8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Kf3fCNP4uFhUr0QHamvKIrx8TCOGGoQtSbiaqhPLeTM=; fh=wiyYoRbVDQOckoQUlmQb/oz6n+w+TjBsbCwj0ol/aQA=; b=BepJ5TwdwoICJk+XHB1dxGckzQorZ/4NbuLMCecP7cUbFTZU3b2oxNU74nlcDH44zT 1jVZ5oG0PKcIBfrDSicpVwZEfjM92iRbij/a7zq0doE/FkgYbwqUbJg2LK1KD2aBFiGy 6+dzdPEmSoZk6J+fiKmIxVRo1wSiqQj8hNoBCVcuFhog4K4htcMFm+b8eJLN2sjrqHRY 3xdE3hoDtURHEdQjtMAuF07XivBx71J3Avl+n7ja4PmSatM5nXkca0DFB2xnmCCtweDK GqMkXl0BjXvBBvkWvoxIt4rp0NioJez6vTb2rxaEb+QO4UK+pxuieyqgE8AI+fUmwA2U qGtA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774536697; x=1775141497; 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=Kf3fCNP4uFhUr0QHamvKIrx8TCOGGoQtSbiaqhPLeTM=; b=YZeNdZf963+aBu42PBLctbqEILNRXG2LVXTDMYDIUm7bjJ3G3z+lBb/ADaMYz+kaBp 4bdGhkhkTfgfzqsJJ4rtM6Ez1s1bksRShSs5ZLEYYkUbSBaKNmfna7MXQTjPFN+Mx22C 6T4vjDfDuMU4z9mNt58Lo9IsRyCeoleKPaUK64sKV97u84MDyuImqTeEqtJi2vaVOi5e iXG0rf+V56WC6TRT+r7oBHwX5utKHb0TludOCgLMWUJDdsSpDG4GOoMGmba4Q3RdkKvk GLH4DM+Si/m6a1Q+IhFSmECJ8w/hCpJb7KGwmWAJHR9Y7DQOYG8FVUQbwMjbcvaEQqcp xVRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774536697; x=1775141497; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Kf3fCNP4uFhUr0QHamvKIrx8TCOGGoQtSbiaqhPLeTM=; b=O3h0LjcLn/tTTKolWR7gdf02aq/nIjWqDioDi6gqNAJtyggq8AKv7MC/QTNUnWBeI3 r2UP2EUHTcnl6TEJsZgxX7DKtV2bOdQ/k8AYWbxbCpZ07dLYxgmZrg4kgBxi5RGGb49S ltyVnpkiH34u0hQI2aVKCIKLBXV8qEYYLsLeA5AXLWCEoN+qYilWybMZKISoghLPJ0me U9JzYNLCH9WGk9/mSz7sm7yIv9odiS8McradjBksnnQvIj5gWfxh3EFOollWnZntqmjp cK+0Gv+gEJfpRAC31/GKk7PVmlLjEpBuWHzVLT1Z04m3qCnOE/82cbDzvDiOYbJfJDXn 556g== X-Forwarded-Encrypted: i=1; AJvYcCVVRmd9lUcRW2RxwzQ4JbTh3xvI2vmxo4HJ4vhVkfxOGQFgR2ZNv+z/kh1yItPTVb9n9FtF/SQLm5wez3Mb@lists.postgresql.org X-Gm-Message-State: AOJu0Yw9yLI1ie9WAfyat3wvg4dYUB+oOX4jOzZwzqqnMIDqkrr6JB1v oaVUxfm2RdeUT07fgk4SXmzb46X+5I+G6GifLUcoqzp1CNL/jbNxt/9NE0vIJ06H7LInHJtoZjg JEhxEXfaZiNSuzzS18bk2WhuYMPzAgxc= X-Gm-Gg: ATEYQzxS2iYG5owiuii2O9QhbzYfPYKCq2NGctmK4Ev91Vap9mCCY1hvqNbBiM3cA0g LyMFbnkUZ8pravX2mRqwR5p5M3d+bzKrZwgY1Z/G7ubgpCaOwWGO6kUOK5jjXHLYvwHXyY4208x 7S1qZ4v5AVegobygxVlVgFIYL7ZQBjyCaqme7ZL218mSl5F3DLfEsyb5EuiPn1A2WOcYuyz+yfz WH0zIoSez5pDm7Kg87oH/EgGvUEnULLwIs98ihONF91ZRK8VhEO+B93mJujFKZ3wglB2l/Zy/9U ys0v1Z3VBTbK1ZVj72Q2kdd9hFou1PjAeZ6WwGv+E/BtFnP5sIsM1BCssL2jVHL5+j+k1VdEjRV T/Dyx7QBiyLUvuSl04XM= X-Received: by 2002:a05:6402:4348:b0:66a:186f:ba1b with SMTP id 4fb4d7f45d1cf-66a8262726cmr5198677a12.5.1774536697025; Thu, 26 Mar 2026 07:51:37 -0700 (PDT) MIME-Version: 1.0 References: <2be31f17-5405-4de9-8d73-90ebc322f7d8@vondra.me> In-Reply-To: From: Melanie Plageman Date: Thu, 26 Mar 2026 10:51:25 -0400 X-Gm-Features: AQROBzATqncpRhAzAQxhahR9C0LXKrepqduBoYvohECuwu3n2jh5nDreZM8-Sc4 Message-ID: Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) To: Tomas Vondra Cc: Andres Freund , Kirill Reshke , Chao Li , Andrey Borodin , Xuneng Zhou , Robert Haas , PostgreSQL Hackers , Heikki Linnakangas 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 Wed, Mar 25, 2026 at 7:29=E2=80=AFPM Tomas Vondra wrot= e: > > >> - Do we really want to pass two sets of flags to table_beginscan_commo= n? > >> I realize it's done to ensure "users" don't use internal flags, but > >> then maybe it'd be better to do that check in the places calling the > >> _common? Someone adding a new caller can break this in various ways > >> anyway, e.g. by setting bits in the internal flags, no? > > > > Yes, callers of table_beginscan_common() could pass flags they > > shouldn't in internal_flags. But I was mostly trying to prevent the > > case where a user picks a flag that overlaps with an internal flag, > > conditionally passes it as a user flag, and then when they test for it > > in their AM-specific code, they aren't actually checking if their own > > flag is set. > > Ah, so we expect people to invent their "own" flags, outside what's in > ScanOptions? Or do I misunderstand how it works? (I admit not reading > the whole massive thread, as I was only interested in using the flags in > my own patch.) Yes, this isn't really explored in the rest of the thread. I thought since the flags are threaded all the way through and they can set/check the flags in the table AM-specific layer, it would make sense that they could choose flags for their own purposes. They don't have to wait for consensus on getting a new SO type added. I don't know if this is a bad idea. However, changing the table AM wrappers seems more justifiable if we are making them extensible in this way. > >> If we want to have these checks, should we be more thorough? Should we > >> check the internal flags only set internal flags? > > > > That's easy enough too. > > Assert((internal_flags & ~SO_INTERNAL_FLAGS) =3D=3D 0); I think does th= e trick. I did this in the previously posted v46. - Melanie