Re: Using max() MUCH slower in v7.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Gordan Bobic" <gordan(at)freeuk(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Using max() MUCH slower in v7.1
Date: 2001-01-18 07:14:07
Message-ID: 1270.979802047@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> 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.

> The problem is that 7.1 isn't pushing the WHERE restriction down into
> the view.

OK, I did something about this ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dan Langille 2001-01-18 07:15:39 GET DIAGNOSTICS SELECT PROCESSED INTO <int4_variable>
Previous Message clemens schmuck 2001-01-18 06:44:38 referencing a sytem table