pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ioana Danes <ioanasoftware@yahoo.ca>
To: Jim C. Nasby <jim@nasby.net>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Dimitri Fontaine <dim@dalibo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Postgresql 8.1.4 - performance issues for select on
Date: Thu, 19 Oct 2006 07:32:56 -0400 (EDT)
Message-ID: <20061019113256.59571.qmail@web55915.mail.re3.yahoo.com> (raw)
In-Reply-To: <20061018223551.GD56874@nasby.net>

Hi,
I tried and this does does not work either.

Thank you,
Ioana
--- "Jim C. Nasby" <jim@nasby.net> wrote:

> On Wed, Oct 18, 2006 at 03:32:15PM -0700, Jeff Davis
> wrote:
> > On Wed, 2006-10-18 at 17:10 -0500, Jim C. Nasby
> wrote:
> > > Sorry, don't have the earlier part of this
> thread, but what about...
> > > 
> > > SELECT greatest(max(a), max(b)) ...
> > > 
> > > ?
> > 
> > To fill you in, we're trying to get the max of a
> union (a view across
> > two physical tables).
> 
> UNION or UNION ALL? You definitely don't want to do
> a plain UNION if you
> can possibly avoid it.
> 
> > It can be done if you're creative with the query;
> I suggested a query
> > that selected the max of the max()es of the
> individual tables. Your
> > query could work too. However, the trick would be
> getting postgresql to
> > recognize that it can transform "SELECT max(x)
> FROM foo" into that,
> > where foo is a view of a union.
> > 
> > If PostgreSQL could sort the result of a union by
> merging the results of
> > two index scans, I think the problem would be
> solved. Is there something
> > preventing this, or is it just something that
> needs to be added to the
> > planner?
> 
> Hrm... it'd be worth trying the old ORDER BY ...
> LIMIT 1 trick just to
> see if that worked in this case, but I don't have
> much hope for that.
> -- 
> Jim Nasby                                           
> jim@nasby.net
> EnterpriseDB      http://enterprisedb.com     
> 512.569.9461 (cell)
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



view thread (16+ messages)  latest in thread

Message-ID: <20061019113256.59571.qmail@web55915.mail.re3.yahoo.com>
Permalink:  ../20061019113256.59571.qmail@web55915.mail.re3.yahoo.com/
Also on:    postgresql.org/message-id/20061019113256.59571.qmail@web55915.mail.re3.yahoo.com

 · 

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: ioanasoftware@yahoo.ca, jim@nasby.net, pgsql@j-davis.com, dim@dalibo.com
  Subject: Re: Postgresql 8.1.4 - performance issues for select on
  In-Reply-To: <20061019113256.59571.qmail@web55915.mail.re3.yahoo.com>

* 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