Re: Using max() MUCH slower in v7.1 - Mailing list pgsql-general

From Robert B. Easter
Subject Re: Using max() MUCH slower in v7.1
Date
Msg-id 01011715533009.02219@comptechnews
Whole thread Raw
In response to Re: Using max() MUCH slower in v7.1  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Wednesday 17 January 2001 12:29, Tom Lane wrote:
> "Gordan Bobic" <gordan@freeuk.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@comptechnews.com ---------
-- CompTechNews Message Board http://www.comptechnews.com/ --
-- CompTechServ Tech Services http://www.comptechserv.com/ --
---------- http://www.comptechnews.com/~reaster/ ------------

pgsql-general by date:

Previous
From: "J.H.M. Dassen (Ray)"
Date:
Subject: Re: Errors compiling 7.0.3 on Solaris 7
Next
From: Joseph Shraibman
Date:
Subject: Re: pg_log