Re: [GENERAL] slow performance of array_agg after upgrade from 9.2 to 9.5

2016-10-28 Thread Tom Lane
jaroet writes: > Internally we upgraded from 9.2 to 9.5 en we had defined an median function. > This became about 7 to 8 times slower using the same functions. > ... > We found that the median function that fills an array is the slow part. When > we change our SQL from

Re: [GENERAL] slow performance of array_agg after upgrade from 9.2 to 9.5

2016-10-27 Thread Pavel Stehule
2016-10-26 15:06 GMT+02:00 jaroet : > Internally we upgraded from 9.2 to 9.5 en we had defined an median > function. > This became about 7 to 8 times slower using the same functions. > > They are defined like this: > > > CREATE OR REPLACE FUNCTION public._final_median(anyarray)

[GENERAL] slow performance of array_agg after upgrade from 9.2 to 9.5

2016-10-27 Thread jaroet
Internally we upgraded from 9.2 to 9.5 en we had defined an median function. This became about 7 to 8 times slower using the same functions. They are defined like this: CREATE OR REPLACE FUNCTION public._final_median(anyarray) RETURNS double precision LANGUAGE sql AS $body$ WITH q AS (