Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E4D99133616B for ; Thu, 28 Oct 2010 15:44:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 69900-05 for ; Thu, 28 Oct 2010 18:44:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gy0-f174.google.com (mail-gy0-f174.google.com [209.85.160.174]) by mail.postgresql.org (Postfix) with ESMTP id 2E1631335B36 for ; Thu, 28 Oct 2010 15:44:46 -0300 (ADT) Received: by gyg4 with SMTP id 4so1472069gyg.19 for ; Thu, 28 Oct 2010 11:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=1IzNSXMd3kQE+j+6Q4DHr0uw9XioOb2pE0ulAhDZHLg=; b=Sz2SV7G0jIpSqDFBflRaM/qprXFIHWzKVWciH0qTInLeg0jWol4IHuitI/f+0oY1zj lNI1ReueqIXSvhiwOlOR9XquxXp+B17oN4obf/kEpDgdu9n68v+ydf8qK5IfXmk/1u4+ jAQokmoq4rFnZWQxjjJn3QYcFBnttUmWLbAhA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=Geq4O+2ZQBOYdQwHBZtn4Gdaek2oTYcrisvekgz84Hz/SmQ7KgzYTPjyJ06b/eyr7h FKMob4jjSsjOrJ/OKLgyfdmblKIXVKdOVLQ+MdFxCZxrnsrM3KZCHrbK6S+gL3Vjtioq SqVs+vMLd/RAMHuYMGkXW7sjP72JjY1BymV2Y= Received: by 10.151.156.19 with SMTP id i19mr20685143ybo.82.1288291485598; Thu, 28 Oct 2010 11:44:45 -0700 (PDT) Received: from [192.168.1.106] (74-95-195-236-SFBA.hfc.comcastbusiness.net [74.95.195.236]) by mx.google.com with ESMTPS id m12sm1010270ybn.12.2010.10.28.11.44.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 28 Oct 2010 11:44:44 -0700 (PDT) Subject: Re: partitioning question 1 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Ben In-Reply-To: <1288287092.22359.23.camel@jd-desktop> Date: Thu, 28 Oct 2010 11:44:41 -0700 Cc: pgsql-performance@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <1288287092.22359.23.camel@jd-desktop> To: jd@commandprompt.com X-Mailer: Apple Mail (2.1081) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/555 X-Sequence-Number: 40973 thanks for the prompt response. some comments / questions below : On Oct 28, 2010, at 10:31 AM, Joshua D. Drake wrote: >> ...constraint exclusion is able to eliminate table partitions. the = I/O advantages of having queries target small subtables are the same as = the I/O advantages of clustering the index : result pages in a small = range are very close to each other on disk. >=20 > Not entirely true. One a clustered index will not stay clustered if = you > are still updating data that is in the partition. You shouldn't > underestimate the benefit of smaller relations in terms of maintenance > either. in my situation, the update come in-order (it is timeseries data and the = clustered index is on time.) so the table should remain relatively = clustered. updates also happen relatively infrequently (once a day in = one batch.) so it appears that we will continue to get the I/O benefits = described above. are there any other benefits which partitioning provides for query = performance (as opposed to update performance) besides the ones which i = have mentioned? > Yes the constraints have to be static. Not sure about the operator > question honestly. this seems to severely restrict their usefulness -- our queries are data = warehouse analytical -type queries, so the constraints are usually = data-driven (come from joining against other tables.) >> is my intuition completely off on this? >=20 > You may actually want to look into expression indexes, not clustered > ones. what would expression indexes give me? thanks and best regards, ben