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 E53049DCC4A for ; Mon, 27 Mar 2006 03:03:17 -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 85289-10 for ; Mon, 27 Mar 2006 03:03:17 -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 378739DCA0C for ; Mon, 27 Mar 2006 03:03:14 -0400 (AST) Received: (qmail 30080 invoked by uid 514); 27 Mar 2006 10:05:30 +0200 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(-2.1/5.0):. Processed in 4.620238 secs); 27 Mar 2006 08:05:30 -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(-2.1/5.0):. Processed in 4.620238 secs Process 29883) 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; 27 Mar 2006 10:05:25 +0200 Message-ID: <44278E27.5090909@rentalia.com> Date: Mon, 27 Mar 2006 09:03:03 +0200 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: Re: Array performance References: <200603170625.k2H6PJ926955@pillette.com> <1143112188.2810.27.camel@theo-laptop.int.coza.net.za> <20060323132448.GB4881@surnet.cl> <4423E90E.2090607@rentalia.com> <5000.1143215504@sss.pgh.pa.us> In-Reply-To: <5000.1143215504@sss.pgh.pa.us> 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.112 required=5 tests=[AWL=0.112] X-Spam-Score: 0.112 X-Spam-Level: X-Archive-Number: 200603/516 X-Sequence-Number: 17953 Tom Lane wrote: >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. > > Already its integer[]