Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XmrAC-0006Uf-9S for pgsql-bugs@arkaria.postgresql.org; Fri, 07 Nov 2014 21:33:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XmrAB-0001QE-Qi for pgsql-bugs@arkaria.postgresql.org; Fri, 07 Nov 2014 21:33:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XmrAB-0001Q8-5R for pgsql-bugs@postgresql.org; Fri, 07 Nov 2014 21:33:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XmrA7-0003iI-LE for pgsql-bugs@postgresql.org; Fri, 07 Nov 2014 21:33:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sA7LXcYD014422; Fri, 7 Nov 2014 16:33:38 -0500 From: Tom Lane To: koposov@ast.cam.ac.uk cc: pgsql-bugs@postgresql.org Subject: Re: BUG #11904: out of memory when scanning large number of partitions In-reply-to: <20141107185824.2513.53433@wrigleys.postgresql.org> References: <20141107185824.2513.53433@wrigleys.postgresql.org> Comments: In-reply-to koposov@ast.cam.ac.uk message dated "Fri, 07 Nov 2014 18:58:24 +0000" Date: Fri, 07 Nov 2014 16:33:38 -0500 Message-ID: <14421.1415396018@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org koposov@ast.cam.ac.uk writes: > I have a large table (few Tb) partitioned in ~ 12000 smaller tables, using > inheritance from the parent one. That's an utterly insane number of partitions. > I noticed that when the user tried to query from the parent table > (not something we plan to do often), PG run out of memory (128 Gb on our > machine). I'm unsurprised. The inheritance infrastructure is only designed to support maybe 100 child tables. If we ever get around to implementing a hard-wired partitioning scheme, it's possible that multiple thousands of partitions could be practical, but it isn't today. Sorry. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs