pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dave Johansen <davejohansen@gmail.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: MAX() and multi-column index on a partitioned table?
Date: Fri, 22 May 2015 18:42:16 -0400
Message-ID: <17857.1432334536@sss.pgh.pa.us> (raw)
In-Reply-To: <CAAcYxUe0J55EpVhFnbJo6A6FHizt6NzfhH2dRGHobXKvpTPjzQ@mail.gmail.com>
References: <CAAcYxUe0J55EpVhFnbJo6A6FHizt6NzfhH2dRGHobXKvpTPjzQ@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Dave Johansen <davejohansen@gmail.com> 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



view thread (4+ messages)  latest in thread

Message-ID: <17857.1432334536@sss.pgh.pa.us>
Permalink:  ../17857.1432334536@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17857.1432334536@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, davejohansen@gmail.com
  Subject: Re: MAX() and multi-column index on a partitioned table?
  In-Reply-To: <17857.1432334536@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox