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 1iY9sS-0007QZ-IH for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Nov 2019 14:25:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iY9sP-00035F-JC for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Nov 2019 14:25:37 +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 1iY9sP-00034q-1A for pgsql-hackers@lists.postgresql.org; Fri, 22 Nov 2019 14:25:37 +0000 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iY9sL-00071O-Mi for pgsql-hackers@postgresql.org; Fri, 22 Nov 2019 14:25:35 +0000 Received: by mail-qv1-xf44.google.com with SMTP id q19so2941418qvs.5 for ; Fri, 22 Nov 2019 06:25:33 -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=Tug06NECslmmcqWaSbg532pGvvNlWfARKkKam3b1vrg=; b=Klolud4FAeWKuzymCLCik3MdWlCL21WItztI/duOmrTtj0wwloGeeJtSEesJa86GcT NxAxjNLlh7RoYbKo6nKGQuR3QpbF6edrlD5yoi9UY1RO6Rx8yMTyhHK0lsRm+923uclg H4xIlnlJDPtMBbGSQdUuS7IdCq6dqu+QSimSvQ5VJy7fZoJ8Oi+vtwllJE8JaXUddB9b ShIsaZSzc9ivSRu0T3Amu86ptTqNOBagXfQj3DsgY77rjO7KEJXh7PABuR7R1OKGsLfD 96t1FdopI6AJAKD/8Ka3JFpxNV83Ijw6ImwXBvx/96ZOT1jaQfABq/Ax0vREGRI1E6HK BwGg== 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=Tug06NECslmmcqWaSbg532pGvvNlWfARKkKam3b1vrg=; b=Oe7cY7VBrH/eUH3SpLHd1rBuWJ3RvnUwQkKPb3rpS8UnBbamto/2G7e7Lv3oemmBRf 1oAV/kR8t42oAQoodaydSrq7iqbzPCXEiUapuWFIlpeV7U8v4I2Shk7pXTDd6SI3Oymj S6/c1EfZpwfm8OWkXkxXov9gV5t9CcMlm8G9oZyiawLga8unIDrKH0QbIJjR0lxI1xSH 5aCwJAa/U2QIAKyyD4928O588a/CBZ+vBnlOBoOcZ07ov3e667gC1fPcWKhy4+ER19l0 5ctjuGWi7RwczN31c2CradeLP+c43Qp+OwqljZW6a34ITWj7fOLo0DkNA+g0+/fyrJOL 0i0g== X-Gm-Message-State: APjAAAVReBbPvhlDgme8kujZ2Ncq0b7lay3pOTOJBN+pEI1ZeGPPqHO9 xnoxePluu097H/DbeBSaqCMqUw== X-Google-Smtp-Source: APXvYqzVA+vzxpWvT5BtggELWALGx27P527Bn8ItlhJCqpknZYh3eLgpELKYQB1qhMcBeoWmNLlp2A== X-Received: by 2002:a0c:ac4b:: with SMTP id m11mr14313950qvb.235.1574432732621; Fri, 22 Nov 2019 06:25:32 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id x39sm3521752qth.92.2019.11.22.06.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2019 06:25:31 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 173B9300A04; Fri, 22 Nov 2019 11:25:28 -0300 (-03) Date: Fri, 22 Nov 2019 11:25:28 -0300 From: Alvaro Herrera To: Michael Paquier Cc: Antonin Houska , Thomas Munro , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: Attempt to consolidate reading of XLOG page Message-ID: <20191122142528.GA6465@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191122134007.GA180646@paquier.xyz> 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, Michael Paquier wrote: > On Fri, Nov 22, 2019 at 10:35:51AM -0300, Alvaro Herrera wrote: > > 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. > > FWIW, this matches with my impression here, third paragraph: > https://www.postgresql.org/message-id/20191120083802.GB47145@paquier.xyz Ah, right. I was wondering if we shouldn't do away with the concept of "offset" as such, since the offset there is always forcibly set to the start of a page. Why don't we count page numbers instead? It seems like the interface is confusingly generic (measure in bytes) yet not offer any extra functionality that could not be obtained with a simpler struct repr (measure in pages). But then that's not something that we need to change in this patch. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services