Re: No stddev() for interval?

From: "Ivan Zolotukhin" <ivan(dot)zolotukhin(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Brendan Jurd" <direvus(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: No stddev() for interval?
Date: 2006-05-20 16:20:17
Message-ID: 751e56400605200920x712aa472g5908aae777e263b6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5/20/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Brendan Jurd" <direvus(at)gmail(dot)com> writes:
> > I noticed a peculiarity in the default postgres aggregate functions. min()=
> > ,
> > max() and avg() support interval as an input type, but stddev() and
> > variance() do not.
>
> > Is there a rationale behind this, or is it just something that was never
> > implemented?
>
> Is it sensible to calculate standard deviation on intervals? How would
> you handle the multiple components? I mean, you could certainly define
> *something*, but how sane/useful would the result be?

Strictly speaking there's nothing bad in intervals. Physically
standart deviation on interval can be very useful without any doubts.
I can make a lot of examples on this. Say you want to know stat
parameters of semi-regular periodical process (avg distance in time
between maximums of some value and stddev of this quasiperiod -- why
not?).

Regards,
Ivan Zolotukhin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-05-20 16:34:47 Re: No stddev() for interval?
Previous Message Tom Lane 2006-05-20 16:05:36 Re: No stddev() for interval?