Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yvve4-0001Ht-U7 for pgsql-performance@arkaria.postgresql.org; Fri, 22 May 2015 22:42:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yvve4-00045V-Ew for pgsql-performance@arkaria.postgresql.org; Fri, 22 May 2015 22:42:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yvve3-00045J-DC for pgsql-performance@postgresql.org; Fri, 22 May 2015 22:42:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Yvve0-0001he-EE for pgsql-performance@postgresql.org; Fri, 22 May 2015 22:42:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t4MMgGcb017858; Fri, 22 May 2015 18:42:16 -0400 From: Tom Lane To: Dave Johansen cc: pgsql-performance Subject: Re: MAX() and multi-column index on a partitioned table? In-reply-to: References: Comments: In-reply-to Dave Johansen message dated "Fri, 22 May 2015 15:27:29 -0700" Date: Fri, 22 May 2015 18:42:16 -0400 Message-ID: <17857.1432334536@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Dave Johansen writes: > I'm trying to call MAX() on the first value of a multi-column index of a > partitioned table and the planner is choosing to do a sequential scan > instead of an index scan. Is there something I can do to fix this? What PG version are you using? 9.1 or newer should know how to do this with a merge append of several indexscans. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance