Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 059392E0038 for ; Fri, 4 Apr 2008 22:07:59 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 23223-08 for ; Fri, 4 Apr 2008 22:07:38 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.234]) by developer.postgresql.org (Postfix) with ESMTP id 9C7882E002D for ; Fri, 4 Apr 2008 22:07:55 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 76so320460wra.10 for ; Fri, 04 Apr 2008 18:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=vm2+AZYSzJzNU0liog60dobPB/Cp/A8DBB7XOZT2unw=; b=j1C3cjKt0/xVlYcpco/HOEsup3y87oSsGBzokTpA6uecuPc4VSiKSP0c+/mM/xqyo/+h9Au41ZTvmlicP1D5LUAdPGgRApsiqJd5fgcWE/Iz+swWwrw13724qy9C/dXrcSuwxyjsde7X8EGLsQDr/mZIyMqmPLmYIPU9HxXsLcg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=Pvd/zDWFm4L6zAwH1YywyBOQMqlPmsZU/pvtl+9b8/kuv6IX3ji4ZvLwqXHsRSTgSTJiOlTSxi0+5Q7HkwDlLYUM3new5qZjmF0bAgFCL5hY/5GMMIBvsY9MwRICwTGiOEqc5CvpEzsSgOzWAPqkcVTtsGbCeLWu35nigaVgPi0= Received: by 10.114.132.5 with SMTP id f5mr3100524wad.125.1207357673267; Fri, 04 Apr 2008 18:07:53 -0700 (PDT) Received: from ?192.168.1.102? ( [24.7.64.54]) by mx.google.com with ESMTPS id m6sm10060988wag.11.2008.04.04.18.07.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Apr 2008 18:07:51 -0700 (PDT) Message-ID: <47F6D0E5.2050005@gmail.com> Date: Fri, 04 Apr 2008 18:07:49 -0700 From: paul rivers User-Agent: Thunderbird 2.0.0.12 (X11/20080227) MIME-Version: 1.0 To: kevin kempter CC: pgsql-performance@postgresql.org Subject: Re: Partitioned tables - planner wont use indexes References: In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/47 X-Sequence-Number: 29540 kevin kempter wrote: > Hi List; > > Sorry if this is a dupe, my first post never showed up... > > I'm having some performance issues with a partitioned table. We have a > VERY large table that we've partitioned by day. > Unfortunately, that is the defined behavior in this case. From 5.9.6 of the manual: "Constraint exclusion only works when the query's WHERE clause contains constants." [Where the constants are of course your partitioning column(s)] The best way around this depends mostly on what you're up to. You can get the min tablename from the catalogs, or you can keep a table of active partitions that your script which drops off old partitions and generates new ones can keep updated on the oldest/newest partition dates. Or some number of other solutions, whatever you find cleanest for your purposes. Paul