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