Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B15AA1337B7F for ; Thu, 28 Oct 2010 17:48:57 -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 17000-01 for ; Thu, 28 Oct 2010 20:48:50 +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 B3DD51337B66 for ; Thu, 28 Oct 2010 17:48:49 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 2F72D348019; Thu, 28 Oct 2010 13:48:41 -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 xJVqLAesvy43; Thu, 28 Oct 2010 13:48:36 -0700 (PDT) Received: from [192.168.1.105] (unknown [75.142.155.118]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 2C8F8348015; Thu, 28 Oct 2010 13:48:36 -0700 (PDT) Subject: Re: partitioning question 1 From: "Joshua D. Drake" Reply-To: jd@commandprompt.com To: Ben Cc: pgsql-performance@postgresql.org In-Reply-To: <73315FB7-240B-480C-9200-D547BCA942DE@gmail.com> References: <1288287092.22359.23.camel@jd-desktop> <1288291814.22359.31.camel@jd-desktop> <4486C61F-DC08-4DE4-8AF9-245FA60B0310@gmail.com> <1288295052.22359.35.camel@jd-desktop> <73315FB7-240B-480C-9200-D547BCA942DE@gmail.com> Content-Type: text/plain; charset="UTF-8" Organization: Command Prompt, Inc. Date: Thu, 28 Oct 2010 13:48:32 -0700 Message-ID: <1288298912.22359.46.camel@jd-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit 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 X-Spam-Level: X-Archive-Number: 201010/562 X-Sequence-Number: 40980 On Thu, 2010-10-28 at 12:59 -0700, Ben wrote: > On Oct 28, 2010, at 12:44 PM, Joshua D. Drake wrote: > > > > My tests show you are incorrect: > > > > > > part_test=# explain analyze select * from foo join bar using (i) where > > i=9; > > QUERY > > PLAN > > ------------------------------------------------------------------------------------------------------------------ > > Nested Loop (cost=34.26..106.76 rows=200 width=20) (actual > > time=0.004..0.004 rows=0 loops=1) > > -> Append (cost=0.00..68.50 rows=20 width=12) (actual > > time=0.004..0.004 rows=0 loops=1) > > -> Seq Scan on foo (cost=0.00..34.25 rows=10 width=12) > > (actual time=0.001..0.001 rows=0 loops=1) > > Filter: (i = 9) > > -> Seq Scan on foo_1 foo (cost=0.00..34.25 rows=10 width=12) > > (actual time=0.000..0.000 rows=0 loops=1) > > Filter: (i = 9) > > -> Materialize (cost=34.26..34.36 rows=10 width=12) (never > > executed) > > -> Seq Scan on bar (cost=0.00..34.25 rows=10 width=12) (never > > executed) > > Filter: (i = 9) > > Total runtime: 0.032 ms > > (10 rows) > > strange. my tests don't agree with your tests : Do you have constraint_exclusion turned on? You should verify with show constraint_exclusion (I saw what you wrote below). JD P.S. Blatant plug, you coming to http://www.postgresqlconference.org ? -- 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