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 1s06cF-000uXZ-1j for pgsql-general@arkaria.postgresql.org; Thu, 25 Apr 2024 21:26:50 +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 1s06bE-002yhy-C0 for pgsql-general@arkaria.postgresql.org; Thu, 25 Apr 2024 21:25:49 +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 1s06bE-002yhq-2e for pgsql-general@lists.postgresql.org; Thu, 25 Apr 2024 21:25:48 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s06b8-0004K1-Bs for pgsql-general@lists.postgresql.org; Thu, 25 Apr 2024 21:25:48 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2dd6c160eaaso18449931fa.1 for ; Thu, 25 Apr 2024 14:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714080341; x=1714685141; 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=BYnrUnIjZQ7SpAbsxyolxCKwu8IAwhxFwWnR9EdVllc=; b=he7gYKWoKbQm16a7CTs5Lp/H5dYYXDmIKGxuwx2ranctOBjaEcQbMwuAs3VlQPc7mS bnAwW0th4G2NQM/V39OGtvMX4KDmLebw+Wdoet7qGEd6NGcZrqFH7wVEtmK0NtCyTCWi RqrndoEVoLAf6G51Blw7Mw9zL68ZatZH0zq9TR2WmsoiqoBL+YW9h7FajbSJMClyj2fF dG2/KtSj+LsTbmpiXLQ0FU7WdE7pb7YQDGxn/8Xs3ELi/Yfun3ny1DhtTmubWJxSaVTO BbLEyOQIzLUVT9FB5Wg+sQg9qQnkbD/qKkEuXgGh8VYqxJBD85VR8KvaKATMuWl9glpK BuZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714080341; x=1714685141; 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=BYnrUnIjZQ7SpAbsxyolxCKwu8IAwhxFwWnR9EdVllc=; b=CxLvSwLQemn1aFL2YWBmd1vECFuj83cM+3tdCFzc1ROMxJ9s3sgXlK8XDPFx5YZHCi NmLVT01fQ7+lnRuDPnXzhrm8MWTZafW/PNINpxSWaBIQTiGwjjIhSMaA7n7Z0zUFsnPt jT3L0TIoe0XpH+d1ivE4SgFXWXIBhyC/JGeiQvTwAZuhbU2bGtiXXDC5XgCO7RMI8dq9 DA2Maqb2+ng/7jrK1mRwFuvHoeRnHrVzz1aFweU2tV4y30TUMdqmm4aDnzR9n61yWDHp LYzjWVXUApGdpJn5QFR/3dmdKARzrSgrwks+lagNFXR7O4URJEEXn/hYXsJp53ukViMo t2dA== X-Gm-Message-State: AOJu0YxoCBOdzwAqhHGTrM+b3ONglN7d7SgmlYrCymTJjfZhjgXajioA 6LSmX+75ZXASMLyroWkKdchpldPLAcgTg7mR8ytGzeBGmcmV8Xkp5y6n98LWEojFhidmNJJ7d9y giEW77BdWaB+SmFn2V936+7DQx4A= X-Google-Smtp-Source: AGHT+IHX6TSMTKJrTMQ/syVHSXWH3JngW4J24iLzJ13MgLQWJrZNbGZaViTc3N9C8VYGja3dPT64JUc7BK7PuNO6wI8= X-Received: by 2002:a2e:8e76:0:b0:2d9:fa96:1620 with SMTP id t22-20020a2e8e76000000b002d9fa961620mr383232ljk.29.1714080340595; Thu, 25 Apr 2024 14:25:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Thomas Munro Date: Fri, 26 Apr 2024 09:25:03 +1200 Message-ID: Subject: Re: Preallocation changes in Postgresql 16 To: Riku Iki 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 Fri, Apr 26, 2024 at 4:37=E2=80=AFAM Riku Iki wro= te: > I am wondering if there were preallocation related changes in PG16, and i= f it is possible to disable preallocation in PostgreSQL 16? I have no opinion on the btrfs details, but I was wondering if someone might show up with a system that doesn't like that change. Here is a magic 8, tuned on "some filesystems": /* * If available and useful, use posix_fallocate() (via * FileFallocate()) to extend the relation. That's often more * efficient than using write(), as it commonly won't cause the ker= nel * to allocate page cache space for the extended pages. * * However, we don't use FileFallocate() for small extensions, as i= t * defeats delayed allocation on some filesystems. Not clear where * that decision should be made though? For now just use a cutoff o= f * 8, anything between 4 and 8 worked OK in some local testing. */ if (numblocks > 8) I wonder if it wants to be a GUC.