Re: [HACKERS] Solution for LIMIT cost estimation

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: chris(at)bitmead(dot)com, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Solution for LIMIT cost estimation
Date: 2000-02-13 23:29:12
Message-ID: 3.0.1.32.20000213152912.010daa30@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 10:11 AM 2/14/00 +1100, Chris Bitmead wrote:

>> Of the standard aggregates, "count()" is probably the only one that
>> could make use of it. And of course only rarely is count() used
>> in such a way.
>
>I think a lot of the agregates could make use of it. For example, tell
>me all the departments who have spent more than $1000,000 this year...
>
>select deptid, sum(amount) > 1000000 from purchases group by deptid;

This would be harder, because you could only guarantee that sum is
of all positive or negative numbers if the user provides a constraint.

>> As someone who has long made his living implementing optimizing
>> compilers, I don't think that optimizing expressions such as the
>> one Chris mentions is all that difficult a task.
>>
>> But there are far more important things to think about implementing
>> in Postgres.
>
>Yep.

Good, because I was about to repeat myself :)

- Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-02-13 23:43:31 Re: [HACKERS] Solution for LIMIT cost estimation
Previous Message Chris Bitmead 2000-02-13 23:17:00 Re: [HACKERS] Solution for LIMIT cost estimation