Subject: O(n^2) aggregates
From: tgl@sss.pgh.pa.us (Tom Lane)
Date: 12/10/2007 10:24:39 AM
Gregory Stark <stark@enterprisedb.com> writes:
> The solution to this would analogous to what we did to count(). We would need
> to add a field to ArrayMetaState which is stored in fn_extra to remember the
> last array returned. Then if array_push notices it has been called from an
> aggregate context it can store its result in there. The next time it would
> extend that array in place (which is code which doesn't currently exist),
contrib/intagg
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
|