Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neJ3H-0004xr-8e for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 16:07:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1neJ3F-0000a8-BA for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 16:07:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neJ3F-0000Zz-1S for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 16:07:33 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1neJ36-0006hn-CA for pgsql-hackers@postgresql.org; Tue, 12 Apr 2022 16:07:31 +0000 Received: by mail-ed1-x534.google.com with SMTP id g20so22930305edw.6 for ; Tue, 12 Apr 2022 09:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=diJeCNeQyuRdWPY0a4VNpKe3mkwXFHJyhDGZAOyOODk=; b=TdyS0QPTbjc8ysd1vXKxAg61Fj1l/SW/AGqp7wBRaYDvEjBT3v6jmNLxnOHv+3iE63 c98qPNhFgsIbcksxUXkfkqVUTbVK2d6CUkZDXc7MNFCGhRvYT/t7cxl2W9xkq8cA3d3V avyjj5JYBkmq79RpRZ9AxNOj26divyxf/fMqu50hXLKsQjsB8dx2cLZCNtlQU5VkwcJw 0bw0De9MRndcaEqT/sO6iQx7Kw7I4ZEFqVO7YmN6pBgNvGOXdJ9gEz47KIcEVkLj8unZ aNkV+G4zatNUEjfWzPEgkdUDGGWBYFHDfJbssRDZyX/bCski+1jLNqnQg4BeqcDeCgwB BFjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=diJeCNeQyuRdWPY0a4VNpKe3mkwXFHJyhDGZAOyOODk=; b=s9k6a4+G4dJRGfP+zl1wBxnYacVYh/LHxANtXs4dOOqZRd1IuMaP0aGm5X1Y/PGk3u YLTZIs/jLMhA3+56KN2QC963v6RN67v5UbKO+IB2RIgeWGILOU9td4yQx1iPlq2bhgam /Li35SeA+gWSyBa9JVtlPT76T6D8CXXzlOkiZMkOoWrm8KVZcMx+CMgw9elO7dYnXd8u HE0ABJLyvVAxy+Nn4bqXpXiVqX84BnmvZ6qiUDWn6fwZqC9zhEwsAi136TOFVugf7ee0 pWLacb6RUft7K3E/09ONvAN4yhr6fsOVatKBXDSqZ0Vetd/A5xLDllGuOrrOjhlWrLnI Q+tg== X-Gm-Message-State: AOAM530ryqLEr3hBEIu6q7zLS2mOAAa8C531Y+bytcQoQ9yV5G/2Xj7/ e3nYFfl0FjP+ttmNk6tlpnF0EZ3wE08Az3rBl+cz7hbgZgJ0Lz7n9pVwCJBlsujD+mbrRgTR4Ql eIctHSsYzC1sMMkF0K7ef7Y1DnWAb/h804ILuwcIIq6+gpDqrhyeRMVyvLqh/LS462a4IQr4382 MQoFHQWSt5k2MCp1RNWm/Q85/hJ2T9T6MXtYrk X-Google-Smtp-Source: ABdhPJwkE/YtzktDwEBtuueZYhX+7vFskpXNlFjtJn9uL0mRP/H5kUMH1vToy9Z/gb0OaFcodSislg== X-Received: by 2002:a05:6402:b2c:b0:41d:7adc:e441 with SMTP id bo12-20020a0564020b2c00b0041d7adce441mr11656194edb.285.1649779642821; Tue, 12 Apr 2022 09:07:22 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-250-165.net.upcbroadband.cz. [86.49.250.165]) by smtp.gmail.com with ESMTPSA id z21-20020a05640240d500b0041d7f66a9cesm3349605edb.41.2022.04.12.09.07.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Apr 2022 09:07:22 -0700 (PDT) Message-ID: <3f4d65c8-ad61-9f57-d5ad-6c1ea841e471@enterprisedb.com> Date: Tue, 12 Apr 2022 18:07:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: WIP: WAL prefetch (another approach) Content-Language: en-US To: Simon Riggs Cc: Thomas Munro , Julien Rouhaud , Ashutosh Sharma , Daniel Gustafsson , Stephen Frost , Alvaro Herrera , Andres Freund , David Steele , Dmitry Dolgov <9erthalion6@gmail.com>, Jakub Wartak , Tom Lane , Tomas Vondra , pgsql-hackers References: <20220309064633.woyf53w3odnhltah@jrouhaud> <20220311082737.bmnlmtzwi2xqrhxl@jrouhaud> <20220314071713.v4anmngdi5njaple@jrouhaud> <20220321082916.ysrlw2xst2tpyc5a@jrouhaud> <03cf0942-662b-8ef5-90e4-b8182f2e1b8d@enterprisedb.com> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/12/22 17:46, Simon Riggs wrote: > On Tue, 12 Apr 2022 at 16:41, Tomas Vondra > wrote: >> >> On 4/12/22 15:58, Simon Riggs wrote: >>> On Thu, 7 Apr 2022 at 08:46, Thomas Munro wrote: >>> >>>> With that... I've finally pushed the 0002 patch and will be watching >>>> the build farm. >>> >>> This is a nice feature if it is safe to turn off full_page_writes. >>> >>> When is it safe to do that? On which platform? >>> >>> I am not aware of any released software that allows full_page_writes >>> to be safely disabled. Perhaps something has been released recently >>> that allows this? I think we have substantial documentation about >>> safety of other settings, so we should carefully document things here >>> also. >>> >> >> I don't see why/how would an async prefetch make FPW unnecessary. Did >> anyone claim that be the case? > > Other way around. FPWs make prefetch unnecessary. > Therefore you would only want prefetch with FPW=off, AFAIK. > > Or put this another way: when is it safe and sensible to use > recovery_prefetch != off? > That assumes the FPI stays in memory until the next modification, and that can be untrue for a number of reasons. Long checkpoint interval with enough random accesses in between is a nice example. See the benchmarks I did a year ago (regular pgbench). Or imagine a r/o replica used to run analytics queries, that access so much data it evicts the buffers initialized by the FPI records. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company