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 1ng9Vd-00015A-9f for pgsql-performance@arkaria.postgresql.org; Sun, 17 Apr 2022 18:20: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 1ng9Vc-0004X5-0R for pgsql-performance@arkaria.postgresql.org; Sun, 17 Apr 2022 18:20:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ng9Vb-0004Ww-Mx for pgsql-performance@lists.postgresql.org; Sun, 17 Apr 2022 18:20:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ng9VZ-0004fn-Nl for pgsql-performance@postgresql.org; Sun, 17 Apr 2022 18:20:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 23HIKOBu2143750; Sun, 17 Apr 2022 14:20:24 -0400 From: Tom Lane To: Benjamin Tingle cc: pgsql-performance@postgresql.org Subject: Re: Query Planner not taking advantage of HASH PARTITION In-reply-to: References: <2132751.1650211749@sss.pgh.pa.us> Comments: In-reply-to Benjamin Tingle message dated "Sun, 17 Apr 2022 10:07:50 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2143748.1650219624.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 17 Apr 2022 14:20:24 -0400 Message-ID: <2143749.1650219624@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Benjamin Tingle writes: > Interesting. Why is it impossible to prune hash partitions? Maybe prune > isn=E2=80=99t the best word, more so use to advantage. At the very least= , it should > be possible to utilize a parallel insert against a table partitioned by > hash. (Partition query rows, then distribute these rows to parallel work= ers) Your plan-shape complaint had nothing to do with insertions; it had to do with joining the partitioned table to another table. That join can't be optimized. regards, tom lane