|
|
|
|
|
by pjungwir
2648 days ago
|
|
I wrote a Postgres extension to compute the mean of an array of floats. [0] I tried to avoid overflow problems by using an approach that finds the final mean for each element as it goes along. [1] But that is a lot of divisions, so there is a disappointing perf hit. (It's still a lot faster than SQL though. :-) I'd love to know if there is a faster way that is still correct. (I have some implementations for SSE2 and AVX that aren't published yet, but they still do all the divisions; what I really want is a different algorithm.) [0] https://github.com/pjungwir/aggs_for_arrays
[1] https://github.com/pjungwir/aggs_for_arrays/blob/master/arra... |
|