X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 77BCAD1B537 for ; Mon, 26 Jul 2004 17:35:02 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 04596-02 for ; Mon, 26 Jul 2004 20:35:02 +0000 (GMT) Received: from boutiquenumerique.com (gailleton-2-82-67-9-10.fbx.proxad.net [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 52F6CD1B57D for ; Mon, 26 Jul 2004 17:34:58 -0300 (ADT) Received: (qmail 28445 invoked from network); 26 Jul 2004 22:34:59 +0200 Received: from unknown (HELO musicbox) (192.168.0.2) by gailleton-2-82-67-9-10.fbx.proxad.net with SMTP; 26 Jul 2004 22:34:59 +0200 To: pgsql-performance@postgresql.org Subject: Re: arrays and indexes References: <6EE64EF3AB31D5448D0007DD34EEB34101AEF1@Herge.rcsinc.local> <20040726045710.GA14892@cnx.rice.edu> <87acxnwaev.fsf@stark.xeocode.com> <20040726184703.GA27820@cnx.rice.edu> Message-ID: From: =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?= Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Mon, 26 Jul 2004 22:35:01 +0200 In-Reply-To: <20040726184703.GA27820@cnx.rice.edu> User-Agent: Opera M2/7.50 (Linux, build 673) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/181 X-Sequence-Number: 7572 >> > SELECT * from content where 42 = ANY (authors); >> Postgres does have a way to do what you ask, though. It involves GiST >> indexes and the operators from the contrib/intarray directory from the >> Postgres source. I have tried to use these indexes, and the performance was very good. It can be faster (in fact much faster) than a join with an additional table, because you don't have a join. The SQL array syntax is a pain, though.