Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id AC13A632B78 for ; Thu, 29 Jul 2010 14:12:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 62831-07 for ; Thu, 29 Jul 2010 17:12:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 2CFC56322DA for ; Thu, 29 Jul 2010 14:12:26 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id C9275348035; Thu, 29 Jul 2010 10:12:19 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aqlIqOfihUn5; Thu, 29 Jul 2010 10:12:17 -0700 (PDT) Received: from [75.142.153.107] (unknown [75.142.153.107]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 1ACAD348002; Thu, 29 Jul 2010 10:12:17 -0700 (PDT) Subject: Re: On Scalability From: "Joshua D. Drake" Reply-To: jd@commandprompt.com To: Vincenzo Romano Cc: pgsql-hackers@postgresql.org In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Organization: Command Prompt, Inc. Date: Thu, 29 Jul 2010 10:12:06 -0700 Message-ID: <1280423526.8613.36.camel@jd-desktop.unknown.charter.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-5 required=5 tests=BAYES_40=-0.001 X-Spam-Level: X-Archive-Number: 201007/1522 X-Sequence-Number: 166711 On Thu, 2010-07-29 at 19:08 +0200, Vincenzo Romano wrote: > Hi all. > I'm wondering about PGSQL scalability. > In particular I have two main topics in my mind: > > 1. What'd be the behavior of the query planner in the case I have > a single huge table with hundreds or thousands of partial indexes > (just differing by the WHERE clause). > This is an idea of mine to make index-partitioning instead of > table-partitioning. Well the planner is not going to care about the partial indexes that don't match the where clause but what you are suggesting is going to make writes and maintenance extremely expensive. It will also increase planning time as the optimizer at a minimum has to discard the use of those indexes. > > 2. What'd be the behavior of the query planner in the case I have > hundreds or thousands of child tables, possibly in a multilevel hierarchy > (let's say, partitioning by year, month and company). Again, test it. Generally speaking the number of child tables directly correlates to planning time. Most experience that 60-100 tables is really the highest you can go. It all depends on actual implementation and business requirements however. Sincerely, Joshua D. Drake -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579 Consulting, Training, Support, Custom Development, Engineering http://twitter.com/cmdpromptinc | http://identi.ca/commandprompt