Re: Array performance - Mailing list pgsql-performance

From Tom Lane
Subject Re: Array performance
Date
Msg-id 5000.1143215504@sss.pgh.pa.us
Whole thread Raw
In response to Array performance  (Ruben Rubio Rey <ruben@rentalia.com>)
Responses Re: Array performance  (Ruben Rubio Rey <ruben@rentalia.com>)
List 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

pgsql-performance by date:

Previous
From: K C Lau
Date:
Subject: limitation using LIKE on ANY(array)
Next
From: Tom Lane
Date:
Subject: Re: Performance problems with multiple layers of functions