Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id AAE0D632CD6 for ; Fri, 12 Feb 2010 14:20:41 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 76241-05 for ; Fri, 12 Feb 2010 18:20:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id CC70B6331C5 for ; Fri, 12 Feb 2010 14:20:30 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o1CIKTFJ018687; Fri, 12 Feb 2010 13:20:29 -0500 (EST) To: "Connors, Bill" cc: pgsql-performance@postgresql.org Subject: Re: Questions on plan with INSERT/SELECT on partitioned table In-reply-to: <6848376EF3611E42B309F0A3D7934BC005C8B0E4@trgmail.rochgrp.com> References: <6848376EF3611E42B309F0A3D7934BC005C8B0E4@trgmail.rochgrp.com> Comments: In-reply-to "Connors, Bill" message dated "Fri, 12 Feb 2010 11:03:05 -0500" Date: Fri, 12 Feb 2010 13:20:29 -0500 Message-ID: <18686.1265998829@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.389 tagged_above=-10 required=5 tests=AWL=0.054, BAYES_00=-2.599, SUBJECT_FUZZY_TION=0.156 X-Spam-Level: X-Archive-Number: 201002/210 X-Sequence-Number: 37631 "Connors, Bill" writes: > ... in my actual system where we have a couple hundred partitions this > query takes minutes to plan. Please note what the documentation says under "Partitioning Caveats". The current partitioning support is not meant to scale past a few dozen partitions. So the solution to your problem is to not have so many partitions. There are plans to make some fundamental changes in partitioning support, and one of the main reasons for that is to allow it to scale to larger numbers of partitions. This is just in the arm-waving stage though ... regards, tom lane