Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 130E09FBAB7 for ; Fri, 20 Apr 2007 18:41:33 -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 87905-04 for ; Fri, 20 Apr 2007 18:41:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from serv01.siteground137.com (ns1.siteground137.com [67.15.250.10]) by postgresql.org (Postfix) with ESMTP id 6EB4C9FBB38 for ; Fri, 20 Apr 2007 18:41:29 -0300 (ADT) Received: from nat.vinton.com ([209.162.219.253]:53471 helo=dogma.v10.wvs) by serv01.siteground137.com with esmtpa (Exim 4.52) id 1Hf0r8-0005u3-33; Fri, 20 Apr 2007 16:41:26 -0500 Subject: Re: index structure for 114-dimension vector From: Jeff Davis To: Andrew Lazarus Cc: pgsql-performance@postgresql.org In-Reply-To: <1217328326.20070420120729@pillette.com> References: <01db01c781e4$c700bf30$2e00a8c0@tridecap.com> <1217328326.20070420120729@pillette.com> Content-Type: text/plain Date: Fri, 20 Apr 2007 14:41:24 -0700 Message-Id: <1177105284.28383.31.camel@dogma.v10.wvs> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 (2.0.4-7) Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - serv01.siteground137.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - j-davis.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/351 X-Sequence-Number: 24228 On Fri, 2007-04-20 at 12:07 -0700, Andrew Lazarus wrote: > I have a table with 2.5 million real[] arrays. (They are points in a > time series.) Given a new array X, I'd like to find, say, the 25 > closest to X in some sense--for simplification, let's just say in the > usual vector norm. Speed is critical here, and everything I have tried > has been too slow. > > I imported the cube contrib package, and I tried creating an index on > a cube of the last 6 elements, which are the most important. Then I Have you tried just making normal indexes on each of the last 6 elements and see if postgresql will use a BitmapAnd to combine them? Regards, Jeff Davis