From: | "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Gordan Bobic" <gordan(at)freeuk(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Using max() MUCH slower in v7.1 |
Date: | 2001-01-17 20:53:30 |
Message-ID: | 01011715533009.02219@comptechnews |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wednesday 17 January 2001 12:29, Tom Lane wrote:
> "Gordan Bobic" <gordan(at)freeuk(dot)com> writes:
> > CREATE VIEW LastDate AS
> > SELECT Company,
> > max(Date) AS Date
> > FROM PastInvoices
> > GROUP BY Company;
> >
> > And then call it like
> > SELECT Date FROM LastDate ORDER BY Date WHERE Company = 'SomeCompany';
> >
> > It takes ABSOLUTELY forever. The table has about 25-30M records.
As long as you are selecting a specific company with that WHERE clause,
isn't that ORDER BY unnecessary?
--
-------- Robert B. Easter reaster(at)comptechnews(dot)com ---------
-- CompTechNews Message Board http://www.comptechnews.com/ --
-- CompTechServ Tech Services http://www.comptechserv.com/ --
---------- http://www.comptechnews.com/~reaster/ ------------
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2001-01-17 20:57:49 | Re: RE: Help with query. (*) |
Previous Message | Joseph Shraibman | 2001-01-17 20:51:06 | Re: postgres 7.0.3 core dumps |