From: Jim C. Nasby <jim@nasby.net>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Dimitri Fontaine <dim@dalibo.com>
Cc: pgsql-performance@postgresql.org, Ioana Danes <ioanasoftware@yahoo.ca>
Subject: Re: Postgresql 8.1.4 - performance issues for select on
Date: Wed, 18 Oct 2006 17:10:46 -0500
Message-ID: <20061018221046.GG85041@nasby.net> (raw)
In-Reply-To: <1161207230.31645.266.camel@dogma.v10.wvs>
References: <20061018210201.56435.qmail@web55907.mail.re3.yahoo.com>
<200610182319.41920.dim@dalibo.com>
<1161207230.31645.266.camel@dogma.v10.wvs>
On Wed, Oct 18, 2006 at 02:33:49PM -0700, Jeff Davis wrote:
> On Wed, 2006-10-18 at 23:19 +0200, Dimitri Fontaine wrote:
> > Le mercredi 18 octobre 2006 23:02, Ioana Danes a ??crit :
> > > I tried the partitioning scenario but I've got into
> > > the same problem. The max function is not using the
> > > indexes on the two partitioned tables...
> > >
> > > Any other thoughts?
> >
> > Did you make sure your test included table inheritance?
> > I'm not sure the planner benefits from constraint_exclusion without selecting
> > the empty parent table (instead of your own union based view).
> >
>
> constraint exclusion and inheritance won't help him.
>
> The problem is that he has two indexes, and he needs to find the max
> between both of them. PostgreSQL isn't smart enough to recognize that it
> can use two indexes, find the max in each one, and find the max of those
> two values.
Sorry, don't have the earlier part of this thread, but what about...
SELECT greatest(max(a), max(b)) ...
?
--
Jim Nasby jim@nasby.net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
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: jim@nasby.net, pgsql@j-davis.com, dim@dalibo.com, ioanasoftware@yahoo.ca
Subject: Re: Postgresql 8.1.4 - performance issues for select on
In-Reply-To: <20061018221046.GG85041@nasby.net>
* 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