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 D604F9DCBA0 for ; Fri, 24 Mar 2006 11:51:41 -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 58131-01 for ; Fri, 24 Mar 2006 11:51:46 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 98FA59DCACE for ; Fri, 24 Mar 2006 11:51:39 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k2OFpiuN005001; Fri, 24 Mar 2006 10:51:44 -0500 (EST) To: Ruben Rubio Rey cc: pgsql-performance@postgresql.org Subject: Re: Array performance In-reply-to: <4423E90E.2090607@rentalia.com> References: <200603170625.k2H6PJ926955@pillette.com> <1143112188.2810.27.camel@theo-laptop.int.coza.net.za> <20060323132448.GB4881@surnet.cl> <4423E90E.2090607@rentalia.com> Comments: In-reply-to Ruben Rubio Rey message dated "Fri, 24 Mar 2006 13:41:50 +0100" Date: Fri, 24 Mar 2006 10:51:44 -0500 Message-ID: <5000.1143215504@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.114 required=5 tests=[AWL=0.114] X-Spam-Score: 0.114 X-Spam-Level: X-Archive-Number: 200603/501 X-Sequence-Number: 17938 Ruben Rubio Rey 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