Skip site navigation (1) Skip section navigation (2)

Re: variance aggregates per SQL:2003

From: David Fetter <david(at)fetter(dot)org>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: variance aggregates per SQL:2003
Date: 2006-03-08 00:58:47
Message-ID: 20060308005847.GB12612@fetter.org (view raw or flat)
Thread:
Lists: pgsql-patches
On Tue, Mar 07, 2006 at 07:56:06PM -0500, Neil Conway wrote:
> On Tue, 2006-03-07 at 16:36 -0800, David Fetter wrote:
> > The rationale is kinda mathematical.  A measure of deviation from
> > central tendency (i.e. variance or stddev) is something where you
> > probably don't want to normalize the weights.
> > 
> > For example, the standard deviation of {0,1,1,1,2} is about 0.707,
> > but the standard deviation of {0,1,2} is 1.
> 
> Well, I realize that stddev(DISTINCT x) != stddev(x) and that most
> people are going to be interested in stddev(x), but I don't think
> it's inconceivable for someone to be interested in stddev(DISTINCT
> x).

Not inconceivable.  Just really hard to justify unless you're trying
to fudge a number ;)

> Explicitly checking for and rejecting it doesn't serve any useful
> purpose that I can see, beyond compliance with the letter of the
> standard -- if the user asks for stddev(DISTINCT x), are we really
> providing useful behavior if we refuse to calculate it?

Nope.  I was just coming up for a rationale for why the standard
disallows it :)

Cheers,
D
-- 
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 415 235 3778

Remember to vote!

In response to

pgsql-patches by date

Next:From: Jonah H. HarrisDate: 2006-03-08 00:59:58
Subject: Re: CREATE SYNONYM ...
Previous:From: Neil ConwayDate: 2006-03-08 00:56:06
Subject: Re: variance aggregates per SQL:2003

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group