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 1pk0Go-0002L1-F4 for pgsql-admin@arkaria.postgresql.org; Wed, 05 Apr 2023 10:21:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pk0Gm-0006Rd-15 for pgsql-admin@arkaria.postgresql.org; Wed, 05 Apr 2023 10:21:36 +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 1pk0Gl-0006RT-Gn for pgsql-admin@lists.postgresql.org; Wed, 05 Apr 2023 10:21:35 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk0Ge-0002nd-Fs for pgsql-admin@lists.postgresql.org; Wed, 05 Apr 2023 10:21:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+81KOEAsPiNpbr0/SCzbXSZvPhSkIpsbAEqNtNA8fZk=; b=ssPuZNdURstkHTsKFHWw8xG1bs nyYqPj3kXQeCQIFr/lAox6NlSpcTH1R3PPzztttcriL2lt2Nv9BC2bFj3KGlGXszzpyiE3VG2ogbZ 4w3BPve7uZFhi5TENycjLzPJ+81PmwK+b2PQE/CoD706r1pWM1c0tS3uMewJLswyVEFI=; Received: from depesz by depesz.com with local (Exim 4.94.2) (envelope-from ) id 1pk0Ga-006N2d-LB; Wed, 05 Apr 2023 12:21:24 +0200 Date: Wed, 5 Apr 2023 12:21:24 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Karthik Krishnakumar Cc: pgsql-admin Subject: Re: Max tables in a cluster? Message-ID: Reply-To: depesz@depesz.com References: <18750398329.1002ca2ba316.8870907212977424118@zohocorp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <18750398329.1002ca2ba316.8870907212977424118@zohocorp.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Apr 05, 2023 at 12:37:41PM +0530, Karthik Krishnakumar wrote: > Is there a limit to number of tables that a cluster can support? Well, yes. For starters: https://www.postgresql.org/docs/current/limits.html But more important is: with large number of tables certain operations become VERY slow. Specifically getting schema dump. Which is used, for example, by pg_upgrade. In my experience hitting 1 million rows in pg_class made it realistically impossible to use pg_dump. But there have been many improvements to pg_dump over the years (https://why-upgrade.depesz.com/show?from=9.5&to=15.2&keywords=pg_dump) to it's possible that the problem is gone now. Try taking `pg_dump -s` of the db, and see how long it takes... Best regards, depesz