X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E912D9FA3CD for ; Mon, 1 May 2006 23:59:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 31980-02 for ; Mon, 1 May 2006 23:59:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id E93F89FA2BE for ; Mon, 1 May 2006 23:59:18 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k422xHhc022531; Mon, 1 May 2006 22:59:17 -0400 (EDT) To: "Mark Liberman" cc: pgsql-performance@postgresql.org Subject: Re: Why is plan (and performance) different on partitioned table? In-reply-to: <9D938282F8C6EE43B748B910386DE93E0138B43C@srvgpimail1.GPI.local> References: <9D938282F8C6EE43B748B910386DE93E0138B43C@srvgpimail1.GPI.local> Comments: In-reply-to "Mark Liberman" message dated "Mon, 01 May 2006 18:37:03 -0700" Date: Mon, 01 May 2006 22:59:16 -0400 Message-ID: <22530.1146538756@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/26 X-Sequence-Number: 18813 "Mark Liberman" writes: > I have recently implemented table partitioning in our postgres 8.1 db. = > Upon analyzing query performance, I have realized that, even when only a = > single one of the "partitions" has to be scanned, the plan is = > drastically different, and performs much worse, when I query against the = > master table (uses merge join), vs. a direct query against the partition = > directly (uses a hash join). The majority of our queries only access a = > single partition. Joins against partitioned tables suck in 8.1 :-(. There is code in CVS HEAD to improve this, but it didn't get done in time for 8.1. regards, tom lane