Re: [PERFORM] Recursive query performance issue

2015-10-23 Thread Pavel Stehule
Hi this extremely high load looks like different issue - maybe spinlock issue or virtual memory issue. Probably you need some low level debug tools like perf or dtrace :( http://www.postgresql.org/message-id/20131206095629.gi7...@awork2.anarazel.de Has you last PostgreSQL upgrade? result of

Re: [PERFORM] GroupAggregate and Integer Arrays

2015-10-23 Thread Jeff Janes
On Fri, Oct 23, 2015 at 7:29 AM, David Osborne wrote: > Hi, > > Wondering if anyone could suggest how we could improve the performance of > this type of query? > The intensive part is the summing of integer arrays as far as I can see. > Postgres does not ship with any 'sum'

Re: [PERFORM] GroupAggregate and Integer Arrays

2015-10-23 Thread David Osborne
Ah yes sorry: I think these cover it... CREATE AGGREGATE sum ( sfunc = array_add, basetype = INTEGER[], stype = INTEGER[], initcond = '{}' ); CREATE OR REPLACE FUNCTION array_add(int[],int[]) RETURNS int[] AS $$ -- Add two arrays. select ARRAY (

Re: [PERFORM] GroupAggregate and Integer Arrays

2015-10-23 Thread Merlin Moncure
On Friday, October 23, 2015, David Osborne wrote: > Hi, > > Wondering if anyone could suggest how we could improve the performance of > this type of query? > The intensive part is the summing of integer arrays as far as I can see. > We're thinking there's not much we can do to

[PERFORM] GroupAggregate and Integer Arrays

2015-10-23 Thread David Osborne
Hi, Wondering if anyone could suggest how we could improve the performance of this type of query? The intensive part is the summing of integer arrays as far as I can see. We're thinking there's not much we can do to improve performance apart from throw more CPU at it... would love to be proven