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 1ga6tY-0005Js-5w for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Dec 2018 22:34:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ga6tW-0003vZ-G7 for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Dec 2018 22:34:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga6tU-0003uK-In for pgsql-hackers@lists.postgresql.org; Thu, 20 Dec 2018 22:34:18 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga6tM-0004X1-0g for pgsql-hackers@lists.postgresql.org; Thu, 20 Dec 2018 22:34:16 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id E5F5715B6; Thu, 20 Dec 2018 17:34:03 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 20 Dec 2018 17:34:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=CB/rIXyKS4Ce6P+GnVorhEbvMix 5CtpxKLhxci677tQ=; b=dVnSJG7ggmB2MhpdlJH0+tSxWVD23S+yZs0YABZjQ3b vcxMQi2gbb6RbUV2g2MfbvLic53Dix9OteM3GWJjpYxfyCKQLKmRWJfzgWLB/i7q FHSvhB1uWnuhm9NEsFdkBEAWHELSBu+D84TDY4ht02WVGHVD8N2dIrzBGD1Hhgqq lLGY8GU8RlwZ9peb3orMcuThVko+YkSdPZuiBC1NG9PVaHSq/VfHjwqBCgT5xv4w 3/JMZ50o6TlEHJYFES157HRprV0bh61AeqGHHOI+tYMvppS3bhwAM71CSWcexV9p YlNLdGybL7K+bPKaXcCmEsjvZSRz3jytO/MoJVe8hEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=CB/rIX yKS4Ce6P+GnVorhEbvMix5CtpxKLhxci677tQ=; b=Wigt1/2tMaz+DGI0vo4B8t LPCx//vgmwfBwuXuoFOHdGjk6DZk2w/x4WIlayq95ZtHq7e7GK1K6gklZmyfrpkG 4jqdDtarbfXHKuWcJq9LKALD1f+lodq/6ga0o7xlW6+w/ZNm33v0+09KAXfaL1CQ /2M9zZvetPWnH8XJMlo1uQMaXv6XWlS9ARuRhP1D8uJzWxYQJWU5ON8Pu0UaNQTh e5UgpczVEBxwkIbG294Oh4K+QM7afSud8VV4v+cQr/ThliJ0Qcu55JrKqaOpvbL7 ZJV3Qj8jj5jR2TbAXGrWGGm5vazVueKXgkqtXLM0v/k0OFQjmTzp2EY9JydMo8ug == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudejfedgudeifecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecu fedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvffukf hfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgvshcuhfhrvghunhguuceo rghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkphepleekrddvuddtrddugedtrd dujedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghl rdguvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 9C89BE4535; Thu, 20 Dec 2018 17:34:02 -0500 (EST) Date: Thu, 20 Dec 2018 14:33:59 -0800 From: Andres Freund To: Tom Lane Cc: Edmund Horner , David Rowley , tomas.vondra@2ndquadrant.com, PostgreSQL Developers Subject: Re: Tid scan improvements Message-ID: <20181220223359.beygiujulocdbmas@alap3.anarazel.de> References: <8469.1545344467@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8469.1545344467@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2018-12-20 17:21:07 -0500, Tom Lane wrote: > Edmund Horner writes: > > [ tid scan patches ] > > I'm having a hard time wrapping my mind around why you'd bother with > backwards TID scans. The amount of code needed versus the amount of > usefulness seems like a pretty bad cost/benefit ratio, IMO. I can > see that there might be value in knowing that a regular scan has > "ORDER BY ctid ASC" pathkeys (mainly, that it might let us mergejoin > on TID without an explicit sort). It does not, however, follow that > there's any additional value in supporting the DESC case. I've not followed this thread, but wouldn't that be quite useful to be able to move old tuples to free space earlier in the table? I've written multiple scripts that update the later pages in a table, to force reuse of earlier free pages (in my case by generating ctid = ANY() style queries with all possible tids for the last few pages, the most efficient way I could think of). Greetings, Andres Freund