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 1sJyoU-007fld-KG for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2024 17:09:38 +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 1sJyoS-002yWU-6I for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2024 17:09:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJyoR-002yUn-RW for pgsql-hackers@lists.postgresql.org; Wed, 19 Jun 2024 17:09:36 +0000 Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJyoL-0026uV-Qh for pgsql-hackers@postgresql.org; Wed, 19 Jun 2024 17:09:35 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.nyi.internal (Postfix) with ESMTP id A551211401CB; Wed, 19 Jun 2024 13:09:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 19 Jun 2024 13:09:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1718816968; x= 1718903368; bh=afoOHiojCXFAH610EpDvDjQcJLTlA49JLG1xy4aEpA8=; b=c MheefvwT6uMmhZYVct0H/rw7YnTebflQhWwdsAjS5oHstX6wxOERtGC1LzeZuHzo NqgTmYf5DdRYdkEc230uDL7ROPCJu7FJBIilOVIoXrBCCYnJbEO0AHkvrfAAHQhv nY+OKuxvgTVKSIGobkjZe8TpAB51Zf5kdi/S9X33GU2j/IPPKFP+qGNK52LkLpwA CsAaW4ZRGNyDOkFIbRKHSHjyeTBeHgD2iE/rmkUoCtC65Y066i9PLYTHD8tk6Puk txRRhtlt4ONCoSgA9/y7Oslh/C/yw2scBmXHEWm9j/LiSeZTD/GR7MXWoptJVJoy FtNxjVwqSYbEzNvCv/waw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeeftddguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeej keffgfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtoh hmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghl vhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Jun 2024 13:09:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1718816966; bh=W3S2ANRDK6fuxvw1XMBL82tv1PDaNBqdeBvDYVpdpLU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=m7UoE9D3i4gQJCNiRv8FcOUyFFwKNvw/3hIdgFZG2KOAM9CLltQIS5BC3Vedbdl8Q 8qQaTdPbaztTHZTN1B88QO7aYVGQVh7CcaMskCBuQBYg1Kkd0BXOpBU0zdoEbbqLdR 16srVU2hdBEmLnQ5O50umEoOnw+LWt7zFEsVFgPzHhFhVhf7bDj1zxK3R5Ro7ocCDh gTZASHWHveoaJ5k1ZjtpZpGzmoG7E8H9Jk6kqSiDGp7JQEOAyh7r9bbsU395mWHLzX JOmBct7315Mscbl/LFsX+Ckc41HmBV2urjQwFWlUnsAJ0QMlXX10ClPhmHWzWbuhkk PwQWmnOomCxrg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 768E3527; Wed, 19 Jun 2024 10:09:26 -0700 (PDT) Date: Wed, 19 Jun 2024 19:09:26 +0200 From: Alvaro Herrera To: Amit Langote Cc: Robert Haas , Andres Freund , Daniel Gustafsson , David Rowley , Jacob Champion , PostgreSQL Hackers , Thom Brown , Tom Lane Subject: Re: generic plans and "initial" pruning Message-ID: <202406191709.jbvpf7d7hl6g@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I had occasion to run the same benchmark you described in the initial email in this thread. To do so I applied patch series v49 on top of 07cb29737a4e, which is just one that happened to have the same date as v49. I then used a script like this (against a server having plan_cache_mode=force_generic_mode) for numparts in 0 1 2 4 8 16 32 48 64 80 81 96 127 128 160 200 256 257 288 300 384 512 1024 1536 2048; do pgbench testdb -i --partitions=$numparts 2>/dev/null echo -ne "$numparts\t" pgbench -n testdb -S -T30 -Mprepared | grep "^tps" | sed -e 's/^tps = \([0-9.]*\) .*/\1/' done and did the same with the commit mentioned above (that is, unpatched). I got this table as result partitions │ patched │ 07cb29737a ────────────┼──────────────┼────────────── 0 │ 65632.090431 │ 68967.712741 1 │ 68096.641831 │ 65356.587223 2 │ 59456.507575 │ 60884.679464 4 │ 62097.426 │ 59698.747104 8 │ 58044.311175 │ 57817.104562 16 │ 59741.926563 │ 52549.916262 32 │ 59261.693449 │ 44815.317215 48 │ 59047.125629 │ 38362.123652 64 │ 59748.738797 │ 34051.158525 80 │ 59276.839183 │ 32026.135076 81 │ 62318.572932 │ 30418.122933 96 │ 59678.857163 │ 28478.113651 127 │ 58761.960028 │ 24272.303742 128 │ 59934.268306 │ 24275.214593 160 │ 56688.790899 │ 21119.043564 200 │ 56323.188599 │ 18111.212849 256 │ 55915.22466 │ 14753.953709 257 │ 57810.530461 │ 15093.497575 288 │ 56874.780092 │ 13873.332162 300 │ 57222.056549 │ 13463.768946 384 │ 54073.77295 │ 11183.558339 512 │ 37503.766847 │ 8114.32532 1024 │ 42746.866448 │ 4468.41359 1536 │ 39500.58411 │ 3049.984599 2048 │ 36988.519486 │ 2269.362006 where already at 16 partitions we can see that things are going downhill with the unpatched code. (However, what happens when the table is not partitioned looks a bit funny.) I hope we can get this new executor code in 18. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "La primera ley de las demostraciones en vivo es: no trate de usar el sistema. Escriba un guión que no toque nada para no causar daños." (Jakob Nielsen)