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 1q4iT7-0001vH-Tf for pgsql-general@arkaria.postgresql.org; Thu, 01 Jun 2023 13:35:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q4iT3-00056w-UC for pgsql-general@arkaria.postgresql.org; Thu, 01 Jun 2023 13:35:53 +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 1q4iPd-0006Kn-Ri for pgsql-general@lists.postgresql.org; Thu, 01 Jun 2023 13:32:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q4iPb-00351v-EG for pgsql-general@lists.postgresql.org; Thu, 01 Jun 2023 13:32:20 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 351DWHDQ3188831; Thu, 1 Jun 2023 09:32:17 -0400 From: Tom Lane To: Jim Vanns cc: pgsql-general@lists.postgresql.org Subject: Re: Dynamic creation of list partitions in highly concurrent write environment In-reply-to: References: Comments: In-reply-to Jim Vanns message dated "Thu, 01 Jun 2023 11:14:17 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3806.1685626337.1@sss.pgh.pa.us> Date: Thu, 01 Jun 2023 09:32:17 -0400 Message-ID: <3807.1685626337@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jim Vanns writes: > Here's the general approach we have, without code and with hypothetical > model, since I'm writing this hastily; > table devices; <-- After trigger on here > table routes; <-- To create physical partition for this logical table > table route_for_device_N; <-- The dynamically created partition > We don't know the device names and thus partitions up front, hence the need > for dynamic creation. How do you go about doing this or is it folly!? Sounds like folly, TBH. You're going to end with a ridiculous number of partitions of the routes table, which will not be good for performance. regards, tom lane