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 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.
Already its integer[]

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

Reply via email to