X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id F067130E667 for ; Thu, 12 Jun 2003 11:24:31 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 46038-05 for ; Thu, 12 Jun 2003 08:24:21 -0300 (ADT) Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by svr1.postgresql.org (Postfix) with ESMTP id 3536930E61A for ; Thu, 12 Jun 2003 08:24:21 -0300 (ADT) Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with SMTP id BAFFEDBFB for ; Thu, 12 Jun 2003 11:24:20 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 0) id 96FEA616F; Thu, 12 Jun 2003 11:24:20 +0000 (GMT) Received: from agx003.agr.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A73E51845 for ; Thu, 12 Jun 2003 11:24:19 +0000 (GMT) Received: from st.com (web.rdd.agr.st.com [164.130.32.138]) by agx003.agr.st.com (8.9.3 (PHNE_24419+JAGae58098)/8.9.3) with ESMTP id NAA04786 for ; Thu, 12 Jun 2003 13:24:18 +0200 (METDST) Message-ID: <3EE8621D.F6A261AE@st.com> Date: Thu, 12 Jun 2003 13:21:01 +0200 From: Marco Vezzoli X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.8 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: multiple index search with postgres7.1.3 on solaris 8 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200306/97 X-Sequence-Number: 13855 Hi everybody, I'm sorry if this topic has already been explained, but the search engine at archives.postgresql.org shows me 10 pages of results but without any link (!). I'm using postgres 7.1.3 on Solaris 8; I would like to do some query of this form SELECT * FROM table WHERE (attribute1,attribute2) IN ((value1_0,value2_0),(value1_1,value2_1) ...) (which is legal on oracle 8i on solaris 8). I know this has an equivalent boolean expression but: -I would like to use an index defined like CREATE INDEX myindex ON table(attribute1,attribute2) -the pairs in the list can be many (up to 100) Postgres supports queries of the form SELECT * FROM table WHERE (attribute1,attribute2) IN (subselect) and SELECT * FROM table WHERE (attribute1,attribute2) = (value1,value2) (which strangely is not supported on oracle!). So I could use the former with a temp table *but* while the latter, according to EXPLAIN, uses the index the former doesn't. Why? Thanks in advance for any help, Marco -- Marco Vezzoli tel. +39 039 603 6852 STMicroelectronics fax. +39 039 603 5055