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

From Tom Lane
Subject Re: Using max() MUCH slower in v7.1
Date
Msg-id 1270.979802047@sss.pgh.pa.us
Whole thread Raw
In response to Re: Using max() MUCH slower in v7.1  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: "Dan Langille"
Date:
Subject: GET DIAGNOSTICS SELECT PROCESSED INTO
Next
From: "J.H.M. Dassen (Ray)"
Date:
Subject: Re: GET DIAGNOSTICS SELECT PROCESSED INTO