bug-gnu-pspp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PSPP-BUG: [bug #11975] AGGREGATE should support MEDIAN function


From: Ben Pfaff
Subject: PSPP-BUG: [bug #11975] AGGREGATE should support MEDIAN function
Date: Tue, 02 Sep 2008 04:07:35 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-1)

Follow-up Comment #4, bug #11975 (project pspp):

>Although there is opportunity to reduce the total number of 
>passes, we can't get around the need to sort and iterate for each 
>median being calculated. 

I cannot dispute that.

>With this patch, the total number of sorts is N and the total 
>number of passes is (N+1), where N is the number of medians to be 
>calculated. With some rework, it could be got down to N sorts and 
>N passes, but I'm not sure if it's worth the effort.

However, if I'm reading the code correctly, it sorts all of the data N times,
whereas it only needs to sort a single column N times.  That means it's doing
a factor of M more work than necessary, where M is the number of variables. 
And there is the very good possibility that a single column could fit in
memory even when all the data cannot.

You're right that it might not be worth it: I don't know whether anyone out
there is doing lots of AGGREGATE with MEDIAN functions.  If you want to commit
it as-is, though, would you mind adding a comment about the kind of
optimization that is possible?

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?11975>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]