From: Ioana Danes <ioanasoftware@yahoo.ca>
To: Jeff Davis <pgsql@j-davis.com>
To: 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 view using max
Date: Thu, 19 Oct 2006 07:23:57 -0400 (EDT)
Message-ID: <20061019112357.66833.qmail@web55908.mail.re3.yahoo.com> (raw)
In-Reply-To: <1161207230.31645.266.camel@dogma.v10.wvs>
Hello,
Actually what I expected from the planner for this
query (select max(transid) from view) was something
like this :
select max(transid) from (select max(transid) from
archive.transaction union all select max(transid) from
public.transaction)
and to apply the max function to each query of the
union. This is what is happening when you use a where
condition, it is using the indexes on each subquery of
the view...
ex: select transid from view where transid = 12;
This way it would be fast enough.
Also for order by and limit I was expecting the same
thing.
Thank you for your time,
Ioana Danes
> 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.
>
> Regards,
> Jeff Davis
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
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, pgsql@j-davis.com, dim@dalibo.com
Subject: Re: Postgresql 8.1.4 - performance issues for select on view using max
In-Reply-To: <20061019112357.66833.qmail@web55908.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