Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iY96O-0005s0-55 for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Nov 2019 13:36:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iY96M-0006co-GV for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Nov 2019 13:35:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iY96M-0006aH-27 for pgsql-hackers@lists.postgresql.org; Fri, 22 Nov 2019 13:35:58 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iY96J-0006ev-Hn for pgsql-hackers@postgresql.org; Fri, 22 Nov 2019 13:35:56 +0000 Received: by mail-qk1-x742.google.com with SMTP id a137so4424024qkc.7 for ; Fri, 22 Nov 2019 05:35:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=VoctPnt1sKHPiLP18m45ZzoIlUUDD6ylSJTafTJh/ZE=; b=c+okatVCEuWt4vF01IHG+wLSHsrSjrc+dgd+rzLnZtgV0eSQjHLDsGu76Q/uDGFx9d RCu6XNehK+4h08FgDoMsaJNTZlGGa8vApgsDaPMI2+eZDA4mfzgU1ND7EPk5ztJcmFTH TcTM/H1ehJ6gLI0NkHfA93NBniYaNwEAF6aughBh4yDvceMaW3qshUD1IL7trBBYHBg2 88Q5+LIe27hf6tQD6CnFmPF5zgPAEcOchhLmCJ9aTvDogak7iLBo2Ycvmt/eEr15T6Ai iqAlBkzT36hqHYG8TCVjJWo4qrZ+hkLGfpawW2T4W52HePIpz4JtxSIHXx64SiYoAcDC bU5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=VoctPnt1sKHPiLP18m45ZzoIlUUDD6ylSJTafTJh/ZE=; b=FVfOsM6WzWfpYt5b4+kpf56/IhC7MvIQr0b8mtSOuUmdYKYihETc9LIL50VKroiA8D rI2iGN6imHjiWAbTYC4fEpdk8Z1pbp91puHMIrEdhU6aooz24HOqw5t2RHW/C3DkzVWn 9lJ6VK1KG6RoBhDTnDjZUd25yJVKemq3pBDkMvLkHZntknk2gSmmYN//qCtC+PuDCBft 8hhEf3Qlvs8zJJM6GnzvAXfreKi9Na/WIogQPIDAkTKT9b8vf+p7Kpz6rJR+6edT4xpe pzKgk0VJ8osSGTGWBKiJxqIjf9pKqz7qypY+MYYBEn3G9ylCN3g/U6cVtTkC3vL9mOXk Dnog== X-Gm-Message-State: APjAAAUxaLgycIt1amR+g+5G7EtX3N6ME9rIGQ2B5B+oZ/xQ3GC646IR v2psemtXcqqKWNGsOXlMLVoZFQ== X-Google-Smtp-Source: APXvYqzJ5DuuCXxshzXwNW5M/PcLgzkp0x9C3pLnwWzOyUlRF9/Fo4zOBp/ArdsYE4k0AccM3RJdWA== X-Received: by 2002:a37:7705:: with SMTP id s5mr13411359qkc.145.1574429754552; Fri, 22 Nov 2019 05:35:54 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([190.95.19.128]) by smtp.gmail.com with ESMTPSA id s7sm2007517qkm.11.2019.11.22.05.35.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2019 05:35:53 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 575EB300A04; Fri, 22 Nov 2019 10:35:51 -0300 (-03) Date: Fri, 22 Nov 2019 10:35:51 -0300 From: Alvaro Herrera To: Antonin Houska Cc: Michael Paquier , Thomas Munro , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: Attempt to consolidate reading of XLOG page Message-ID: <20191122133551.GA4216@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <454.1574407712@antos> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Nov-22, Antonin Houska wrote: > I thought that in [1] you try discourage me from using pg_pread(), but now it > seems to be the opposite. Ideally I'd like to see no overhead added by my > patch at all, but the code simplicity should matter too. FWIW I think the new code is buggy because it doesn't seem to be setting ws_off, so I suppose the optimization in ReadPageInternal to skip reading the page when it's already the page we have is not hit, except for the first page in the segment. I didn't verify this, just my impression while reading the code. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services