Re: Array performance

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ruben Rubio Rey <ruben@rentalia.com>
Cc: pgsql-performance@postgresql.org
Date: 2006-03-24T15:51:44Z
Lists: pgsql-performance
Ruben Rubio Rey <ruben@rentalia.com> 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 the array datatype?  Integer or float would probably go a lot
faster than NUMERIC, if that's what you're using now.

			regards, tom lane