Re: optimize query with a maximum(date) extraction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>, "Peter Childs" <peterachilds(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: optimize query with a maximum(date) extraction
Date: 2007-09-05 15:23:38
Message-ID: 13389.1189005818@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> You can simulate such a plan with the subqueries I described but
> there's a bit more overhead than necessary and you need a reasonably
> efficient source of the distinct ids.

Yeah, that seems like the $64 question. If you have no better way of
finding out the set of ID values than a seqscan, then there's no point
in trying to optimize the min/max accumulation ...

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2007-09-05 15:45:24 Re: Performance on 8CPU's and 32GB of RAM
Previous Message Carlo Stonebanks 2007-09-05 15:23:05 Re: Performance on 8CPU's and 32GB of RAM