Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 857FB9F96B6 for ; Wed, 22 Aug 2007 10:25:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 38461-03 for ; Wed, 22 Aug 2007 10:25:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mtao01.charter.net (mtao01.charter.net [209.225.8.186]) by postgresql.org (Postfix) with ESMTP id 7740F9F9686 for ; Wed, 22 Aug 2007 10:25:35 -0300 (ADT) Received: from aa03.charter.net ([10.20.200.155]) by mtao01.charter.net (InterMail vM.7.08.02.00 201-2186-121-20061213) with ESMTP id <20070822132529.BWOB18969.mtao01.charter.net@aa03.charter.net>; Wed, 22 Aug 2007 09:25:29 -0400 Received: from [10.0.1.2] (really [66.188.165.91]) by aa03.charter.net with ESMTP id <20070822132529.KIMX7864.aa03.charter.net@[10.0.1.2]>; Wed, 22 Aug 2007 09:25:29 -0400 In-Reply-To: <46CC16F3.7060606@pws.com.au> References: <200708221210.36770.scldad@sdc.com.au> <46CC16F3.7060606@pws.com.au> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: Stephen Davies , pgsql-performance@postgresql.org Content-Transfer-Encoding: 7bit From: Michael Glaesemann Subject: Re: Optimising "in" queries Date: Wed, 22 Aug 2007 08:25:26 -0500 To: Russell Smith X-Mailer: Apple Mail (2.752.2) X-Chzlrs: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/234 X-Sequence-Number: 26364 On Aug 22, 2007, at 5:58 , Russell Smith wrote: > Stephen Davies wrote: >> select count(rdate),rdate from reading where sensor_id in >> (1137,1138,1139,1140) group by rdate order by rdate desc limit 1; >> >> > It would have been helpful to see the table definition here. I can > say up front that array processing in postgres is SLOW. Um, what array processing are you seeing here? IN (a, b, b) is not an array construct. Michael Glaesemann grzm seespotcode net