Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C7498632D36 for ; Mon, 8 Mar 2010 15:27:11 -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 90887-10 for ; Mon, 8 Mar 2010 19:26:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f187.google.com (mail-iw0-f187.google.com [209.85.223.187]) by mail.postgresql.org (Postfix) with ESMTP id 254B7632322 for ; Mon, 8 Mar 2010 15:27:01 -0400 (AST) Received: by iwn17 with SMTP id 17so2049034iwn.19 for ; Mon, 08 Mar 2010 11:27:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=gUiLYt6swsUGze+O0HwXy3tVQOR5uG/weizGRoiTUxc=; b=MMTjVHJRvgE6ZKSg+9EYPniJ65AT35CRdXuBSufbEJ41ZTUZa0ar5JUFgptvY8eNaE vq5LlnswPi0N+KrkODy/sHLtvoYx1COPkCsqp26NjQN/7G24rqggoH6Le64lNJ32eIAZ 1tnyyRoh3AE+iyxP6CDiDeIYoBaakfVP6wBwI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Jdc+c3J5Ve+1k6iI+cbqLLAHDtia9XzWeEexPn9JMfQmtNctSMcYko1dw5OO/W+o3+ c+Gsd3rpcdXhYwJXmdE9Fp0y2OANTs6Vmd2hb+JE9kBmAlCl0DOkyf6U6cAkyNz3jC3F gX6NxHilQKpgC0HPEVVcBDTq0QLJL8vO7lsJs= MIME-Version: 1.0 Received: by 10.231.146.130 with SMTP id h2mr66386ibv.43.1268076420081; Mon, 08 Mar 2010 11:27:00 -0800 (PST) In-Reply-To: <6645f6441003081028v6dbca8f4s2a480114b86cb2a6@mail.gmail.com> References: <6645f6441003081028v6dbca8f4s2a480114b86cb2a6@mail.gmail.com> Date: Mon, 8 Mar 2010 11:27:00 -0800 Message-ID: Subject: Re: Paritioning vs. caching From: Anj Adu To: Konrad Garus Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.35 tagged_above=-10 required=5 tests=AWL=0.249, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/76 X-Sequence-Number: 37901 If the partitioned column in your where clause does not use hardcoded values ...e.g datecolumn between 'year1' and 'year2' ..the query planner will check all partitions ..this is a known issue with the optimizer On Mon, Mar 8, 2010 at 10:28 AM, Konrad Garus wrote: > Hello, > > I am evaluating a materialized view implemented as partitioned table. > At the moment the table is partitioned yearly and contains 5 > numeric/timestamp columns. One of the columns is ID (but it's not what > the table is partitioned on). > > Partition for one year occupies about 1200 MB. Each of the columns is > indexed, with each index weighing about 160 MB. I am trying to avoid > RAM/disk thrashing. Now I have the following questions: > > 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. > > 2. Is it possible to tell which PG objects are read from disk (because > they were not found in RAM)? > > Thank you. > > -- > Konrad Garus > > -- > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance >