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 1ng9ye-0002xo-T3 for pgsql-performance@arkaria.postgresql.org; Sun, 17 Apr 2022 18:50:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ng9yc-0007MN-Ud for pgsql-performance@arkaria.postgresql.org; Sun, 17 Apr 2022 18:50:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ng9yb-0007ME-MS for pgsql-performance@lists.postgresql.org; Sun, 17 Apr 2022 18:50:26 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ng9yY-0002gW-0L for pgsql-performance@postgresql.org; Sun, 17 Apr 2022 18:50:24 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id BFDC75C012A; Sun, 17 Apr 2022 14:50:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 17 Apr 2022 14:50:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1650221417; x=1650307817; bh=UQdHa3wGOaRWdZt17H6etgfRv77A 8MQBsPzsShuYUmc=; b=Sv54rdUFGIWDPNGv/Ti6yUqsCG7Q7R45BcR8kq5WTkSU FGIxbsTQJ2s7lCiE0dki5K1NwmQ6ZICP24GR/TgEjwzA+n8/r9/FRps7CdHO/NRB 1bndYCeMDX3DA2NDECrE3qlux/FCk33GzbCrjfzOfPXLVgU474oTmTUAUOhMgfNu AJU+m2DqT+v2fkIWggFY5rRSVKK/YuKp+OUOqJpkFkPJVIgicPHmcofW+NmNPylo 303aCCOGYqT1WJDGoufF97djdnoewVM65WmP8cozQLMX+aVdY4mUiCuStP0xuDHw 4GjkjE6DItcvx+Cx6hpd8jHR6yStua2F5ulZIP1n1A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudelledgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjsehtke ertddttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhr vgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedujeevjeffje evuddutedvkeeiueeitddvieelfeekveejudefgeeuvdejhfeuleenucffohhmrghinhep vghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhr gh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 17 Apr 2022 14:50:17 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 304A42A0CBF; Sun, 17 Apr 2022 20:50:14 +0200 (CEST) Date: Sun, 17 Apr 2022 20:50:14 +0200 From: Alvaro Herrera To: Benjamin Tingle Cc: pgsql-performance@postgresql.org Subject: Re: Query Planner not taking advantage of HASH PARTITION Message-ID: <202204171850.iqpjc2mmr47y@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 On 2022-Apr-14, Benjamin Tingle wrote: > It doesn't help if I partition temp_data by textfield beforehand either > (using the same scheme as the target table). It still opts to concatenate > all of temp_data, hash it, then perform a sequential scan against the > target partitions. Does it still do that if you set SET enable_partitionwise_join TO on; ? If the partition strategies are identical, that might get you a better plan. (Actually, in pg13 and upwards the strategies don't need to be exactly identical, just "compatible".) -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end." (2nd Commandment for C programmers)