Re: [HACKERS] Weighted Stats

2016-04-08 Thread David Fetter
On Fri, Mar 18, 2016 at 06:12:12PM -0700, Jeff Janes wrote: > On Tue, Mar 15, 2016 at 8:36 AM, David Fetter wrote: > > > > Please find attached a patch that uses the float8 version to cover the > > numeric types. > > Is there a well-defined meaning for having a negative weight? If no, > should i

Re: [HACKERS] Weighted Stats

2016-04-08 Thread David Fetter
On Fri, Apr 08, 2016 at 01:47:56PM -0700, David Fetter wrote: > Sorry about the delay. This patch disallows negative weights, > although it still has that odd difference Jeff found. Difference corrected. It turned out that my reference was mistaken on the calculation. Cheers, David. -- David F

Re: [HACKERS] Weighted Stats

2016-04-08 Thread David Fetter
On Sun, Mar 20, 2016 at 03:38:40PM -0700, David Fetter wrote: > On Sat, Mar 19, 2016 at 05:04:08PM +0100, Tomas Vondra wrote: > > Hi, > > > > On 03/19/2016 07:34 AM, David Fetter wrote: > > >On Fri, Mar 18, 2016 at 06:12:12PM -0700, Jeff Janes wrote: > > >>On Tue, Mar 15, 2016 at 8:36 AM, David Fe

Re: [HACKERS] Weighted Stats

2016-03-20 Thread David Fetter
On Sat, Mar 19, 2016 at 05:04:08PM +0100, Tomas Vondra wrote: > Hi, > > On 03/19/2016 07:34 AM, David Fetter wrote: > >On Fri, Mar 18, 2016 at 06:12:12PM -0700, Jeff Janes wrote: > >>On Tue, Mar 15, 2016 at 8:36 AM, David Fetter wrote: > >>> > >>>Please find attached a patch that uses the float8

Re: [HACKERS] Weighted Stats

2016-03-19 Thread Tomas Vondra
Hi, On 03/19/2016 07:34 AM, David Fetter wrote: On Fri, Mar 18, 2016 at 06:12:12PM -0700, Jeff Janes wrote: On Tue, Mar 15, 2016 at 8:36 AM, David Fetter wrote: Please find attached a patch that uses the float8 version to cover the numeric types. Is there a well-defined meaning for having

Re: [HACKERS] Weighted Stats

2016-03-19 Thread Jeff Janes
On Fri, Mar 18, 2016 at 11:34 PM, David Fetter wrote: > On Fri, Mar 18, 2016 at 06:12:12PM -0700, Jeff Janes wrote: >> Also, I think it might not give the correct answer even without >> negative weights: >> >> create table foo as select floor(random()*1)::int val from >> generate_series(1,100

Re: [HACKERS] Weighted Stats

2016-03-18 Thread David Fetter
On Fri, Mar 18, 2016 at 06:12:12PM -0700, Jeff Janes wrote: > On Tue, Mar 15, 2016 at 8:36 AM, David Fetter wrote: > > > > Please find attached a patch that uses the float8 version to cover the > > numeric types. > > Is there a well-defined meaning for having a negative weight? If no, > should i

Re: [HACKERS] Weighted Stats

2016-03-18 Thread Jeff Janes
On Tue, Mar 15, 2016 at 8:36 AM, David Fetter wrote: > > Please find attached a patch that uses the float8 version to cover the > numeric types. Is there a well-defined meaning for having a negative weight? If no, should it be disallowed? I don't know what I was expecting, but not this: selec

Re: [HACKERS] Weighted Stats

2016-03-15 Thread David Fetter
On Fri, Jan 08, 2016 at 04:37:36PM +1100, Haribabu Kommi wrote: > On Mon, Dec 21, 2015 at 1:50 PM, David Fetter wrote: > > On Sun, Dec 20, 2015 at 06:13:33PM -0600, Jim Nasby wrote: > >> On 11/2/15 5:46 PM, David Fetter wrote: > >> >I'd like to add weighted statistics to PostgreSQL > >> > >> Anyth

Re: [HACKERS] Weighted Stats

2016-01-28 Thread Alvaro Herrera
I'm closing this for the current commitfest as returned-with-feedback. Please resubmit for the 2016-03 CF once you have it. Thanks! -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mail

Re: [HACKERS] Weighted Stats

2016-01-11 Thread David Fetter
On Fri, Jan 08, 2016 at 04:37:36PM +1100, Haribabu Kommi wrote: > On Mon, Dec 21, 2015 at 1:50 PM, David Fetter wrote: > > On Sun, Dec 20, 2015 at 06:13:33PM -0600, Jim Nasby wrote: > >> On 11/2/15 5:46 PM, David Fetter wrote: > >> >I'd like to add weighted statistics to PostgreSQL > >> > >> Anyth

Re: [HACKERS] Weighted Stats

2016-01-07 Thread Haribabu Kommi
On Mon, Dec 21, 2015 at 1:50 PM, David Fetter wrote: > On Sun, Dec 20, 2015 at 06:13:33PM -0600, Jim Nasby wrote: >> On 11/2/15 5:46 PM, David Fetter wrote: >> >I'd like to add weighted statistics to PostgreSQL >> >> Anything happen with this? If community isn't interested, ISTM it'd be good >> to

Re: [HACKERS] Weighted Stats

2015-12-20 Thread David Fetter
On Sun, Dec 20, 2015 at 06:13:33PM -0600, Jim Nasby wrote: > On 11/2/15 5:46 PM, David Fetter wrote: > >I'd like to add weighted statistics to PostgreSQL > > Anything happen with this? If community isn't interested, ISTM it'd be good > to put this in PGXN. I think it's already in PGXN as an exten

Re: [HACKERS] Weighted Stats

2015-12-20 Thread Jim Nasby
On 11/2/15 5:46 PM, David Fetter wrote: I'd like to add weighted statistics to PostgreSQL Anything happen with this? If community isn't interested, ISTM it'd be good to put this in PGXN. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture an

[HACKERS] Weighted Stats

2015-11-02 Thread David Fetter
Folks, I'd like to add weighted statistics to PostgreSQL. While the included weighted_avg() is trivial to calculate using existing machinery, the included weighted_stddev_*() functions are not. I've only done the float8 versions, but if we decide to move forward, I'd be delighted to add the rest