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 1njtZs-0000dj-Uh for pgsql-performance@arkaria.postgresql.org; Thu, 28 Apr 2022 02:08:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1njtZr-0004h7-FV for pgsql-performance@arkaria.postgresql.org; Thu, 28 Apr 2022 02:08:19 +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 1njtZr-0004gk-5d for pgsql-performance@lists.postgresql.org; Thu, 28 Apr 2022 02:08:19 +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 1njtZo-0000Mq-NH for pgsql-performance@lists.postgresql.org; Thu, 28 Apr 2022 02:08:18 +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 23S28Eex503302; Wed, 27 Apr 2022 22:08:15 -0400 From: Tom Lane To: =?iso-8859-1?Q?Andr=E9_H=E4nsel?= cc: pgsql-performance@lists.postgresql.org Subject: Re: Unworkable plan above certain row count In-reply-to: <035001d85a9a$4dcfd840$e96f88c0$@webkr.de> References: <035001d85a9a$4dcfd840$e96f88c0$@webkr.de> Comments: In-reply-to =?iso-8859-1?Q?Andr=E9_H=E4nsel?= message dated "Thu, 28 Apr 2022 02:52:57 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <503300.1651111694.1@sss.pgh.pa.us> Date: Wed, 27 Apr 2022 22:08:14 -0400 Message-ID: <503301.1651111694@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?iso-8859-1?Q?Andr=E9_H=E4nsel?= writes: > Now if you change > INSERT INTO a(a_id) SELECT generate_series(1, 20000); > to > INSERT INTO a(a_id) SELECT generate_series(1, 200000); > i.e. add a zero, the plan becomes [ not a hashed subplan ] Yeah, it won't hash the subplan if the estimated size of the hash table exceeds work_mem. In this case, boosting work_mem would be a mighty good idea. regards, tom lane