Re: [PERFORM] Array performance

2006-03-26 Thread Ruben Rubio Rey
Tom Lane wrote: Ruben Rubio Rey [EMAIL PROTECTED] writes: SELECT (array[20]+array[21]+ ... +array[50]+array[51]) as total FROM table WHERE (array[20]+array[21]+ ... +array[50]+array[51])5000 AND array[20]0 AND array[21]0 ... AND array[50]0 AND array[51])0 Any ideas to make this query

[PERFORM] Array performance

2006-03-24 Thread Ruben Rubio Rey
Hi, I have a select like SELECT (array[20]+array[21]+ ... +array[50]+array[51]) as total FROM table WHERE (array[20]+array[21]+ ... +array[50]+array[51])5000 AND array[20]0 AND array[21]0 ... AND array[50]0 AND array[51])0 Any ideas to make this query faster? ---(end

Re: [PERFORM] Array performance

2006-03-24 Thread Jim C. Nasby
On Fri, Mar 24, 2006 at 01:41:50PM +0100, Ruben Rubio Rey wrote: Hi, I have a select like SELECT (array[20]+array[21]+ ... +array[50]+array[51]) as total FROM table WHERE (array[20]+array[21]+ ... +array[50]+array[51])5000 http://www.varlena.com/GeneralBits/109.php might provide some

Re: [PERFORM] Array performance

2006-03-24 Thread Ruben Rubio Rey
Jim C. Nasby wrote: On Fri, Mar 24, 2006 at 01:41:50PM +0100, Ruben Rubio Rey wrote: Hi, I have a select like SELECT (array[20]+array[21]+ ... +array[50]+array[51]) as total FROM table WHERE (array[20]+array[21]+ ... +array[50]+array[51])5000

Re: [PERFORM] Array performance

2006-03-24 Thread Jim C. Nasby
On Fri, Mar 24, 2006 at 02:01:29PM +0100, Ruben Rubio Rey wrote: http://www.varlena.com/GeneralBits/109.php might provide some useful insights. I also recall seeing something about sum operators for arrays, but I can't recall where. I ll check it out, seems to be very useful Is faster

Re: [PERFORM] Array performance

2006-03-24 Thread Michael Fuhr
On Fri, Mar 24, 2006 at 07:06:19AM -0600, Jim C. Nasby wrote: On Fri, Mar 24, 2006 at 02:01:29PM +0100, Ruben Rubio Rey wrote: mmm ... i have read in postgres documentation that null values on arrays are not supported ... Damn, you're right. Another reason I tend to stay away from them...

Re: [PERFORM] Array performance

2006-03-24 Thread Tom Lane
Ruben Rubio Rey [EMAIL PROTECTED] writes: SELECT (array[20]+array[21]+ ... +array[50]+array[51]) as total FROM table WHERE (array[20]+array[21]+ ... +array[50]+array[51])5000 AND array[20]0 AND array[21]0 ... AND array[50]0 AND array[51])0 Any ideas to make this query faster? What's