Re: [HACKERS] Aggregate Supporting Functions

2015-06-12 Thread David Rowley
On 10 June 2015 at 02:26, Tom Lane wrote: > Kevin Grittner writes: > > David Rowley wrote: > >> [ avoid duplicate calculations for related aggregates ] > > > From the information you have proposed storing, with cost factors > > associated with the functions, it seems technically possible to > >

Re: [HACKERS] Aggregate Supporting Functions

2015-06-09 Thread David Rowley
On 10 June 2015 at 01:53, Kevin Grittner wrote: > David Rowley wrote: > > > 3. Add logic in the planner to look for look for supporting > > cases. With logic something along the lines of: > > > > a. Does the query have any aggregates? If not -> return; > > b. Does the query have more than 1

Re: [HACKERS] Aggregate Supporting Functions

2015-06-09 Thread Kevin Grittner
Tom Lane wrote: > Kevin Grittner writes: >> David Rowley wrote: >>> [ avoid duplicate calculations for related aggregates ] >> From the information you have proposed storing, with cost factors >> associated with the functions, it seems technically possible to >> infer that you could run (for ex

Re: [HACKERS] Aggregate Supporting Functions

2015-06-09 Thread Tom Lane
Kevin Grittner writes: > David Rowley wrote: >> [ avoid duplicate calculations for related aggregates ] > From the information you have proposed storing, with cost factors > associated with the functions, it seems technically possible to > infer that you could run (for example) the avg() aggrega

Re: [HACKERS] Aggregate Supporting Functions

2015-06-09 Thread Kevin Grittner
David Rowley wrote: > The idea is that we skip a major chunk of processing in > situations like: > > SELECT avg(x),sum(x),count(x) FROM bigtable; > > Because avg(x) already technically knows what the values of > sum(x) and count(x) are. That has occurred to me as a possible optimization, but I h

[HACKERS] Aggregate Supporting Functions

2015-06-08 Thread David Rowley
I believe this is an idea that's been discussed before, but I'm not exactly sure where that happened: Overview: The idea is that we skip a major chunk of processing in situations like: SELECT avg(x),sum(x),count(x) FROM bigtable; Because avg(x) already technically knows what the values of sum(x