Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id ECFCD632A38 for ; Mon, 8 Mar 2010 16:30:18 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 01266-01 for ; Mon, 8 Mar 2010 20:30:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from glacier.frostconsultingllc.com (glacier.frostconsultingllc.com [69.36.227.170]) by mail.postgresql.org (Postfix) with ESMTP id 4004F6329FD for ; Mon, 8 Mar 2010 16:30:06 -0400 (AST) Received: from dsl081-245-111.sfo1.dsl.speakeasy.net ([64.81.245.111] helo=Sidney-Stratton.local) by glacier.frostconsultingllc.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.69) (envelope-from ) id 1NojaV-0006w1-Ve; Mon, 08 Mar 2010 12:30:05 -0800 Message-ID: <4B955E4B.9060805@agliodbs.com> Date: Mon, 08 Mar 2010 12:30:03 -0800 From: Josh Berkus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2 MIME-Version: 1.0 To: Konrad Garus CC: pgsql-performance@postgresql.org Subject: Re: Paritioning vs. caching References: <6645f6441003081028v6dbca8f4s2a480114b86cb2a6@mail.gmail.com> In-Reply-To: <6645f6441003081028v6dbca8f4s2a480114b86cb2a6@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/77 X-Sequence-Number: 37902 > 1. When I query the table by ID, it performs index scan on each > partition. The result is only found in one partition, but I understand > why it needs to look in all of them. How much disk reading does it > involve? Is only the "head" of indexes for partitions that do not > include the row scanned, or are always whole indexes read? I would > like to know the general rule for index scans. If you're not including the partition criterion in most of your queries, you're probably partitioning on the wrong value. --Josh Berkus