X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 9F7559DC87D for ; Fri, 24 Mar 2006 08:42:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 99450-02 for ; Fri, 24 Mar 2006 08:42:13 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.rentalia.net (mail.rentalia.com [213.192.209.8]) by postgresql.org (Postfix) with ESMTP id B36C29DC842 for ; Fri, 24 Mar 2006 08:42:07 -0400 (AST) Received: (qmail 2300 invoked by uid 514); 24 Mar 2006 14:44:33 +0100 Received: from 62.37.217.236 by rigodon (envelope-from , uid 512) with qmail-scanner-1.25-st-qms (clamdscan: 0.88/1284. spamassassin: 3.0.2. perlscan: 1.25-st-qms. Clear:RC:0(62.37.217.236):SA:0(-1.0/5.0):. Processed in 0.605313 secs); 24 Mar 2006 13:44:33 -0000 X-Antivirus-MYDOMAIN-Mail-From: ruben@rentalia.com via rigodon X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(62.37.217.236):SA:0(-1.0/5.0):. Processed in 0.605313 secs Process 2290) Received: from 62-37-217-236.mad1.adsl.uni2.es (HELO ?192.168.2.28?) (ruben@rentalia.com@62.37.217.236) by mail.rentalia.net with SMTP; 24 Mar 2006 14:44:32 +0100 Message-ID: <4423E90E.2090607@rentalia.com> Date: Fri, 24 Mar 2006 13:41:50 +0100 From: Ruben Rubio Rey User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051011) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Array performance References: <200603170625.k2H6PJ926955@pillette.com> <1143112188.2810.27.camel@theo-laptop.int.coza.net.za> <20060323132448.GB4881@surnet.cl> In-Reply-To: <20060323132448.GB4881@surnet.cl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.109 required=5 tests=[AWL=0.109] X-Spam-Score: 0.109 X-Spam-Level: X-Archive-Number: 200603/487 X-Sequence-Number: 17924 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?