pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marco Vezzoli <marco.vezzoli@st.com>
To: pgsql-sql@postgresql.org
Subject: multiple index search with postgres7.1.3 on solaris 8
Date: Thu, 12 Jun 2003 13:21:01 +0200
Message-ID: <3EE8621D.F6A261AE@st.com> (raw)

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



view thread (3+ messages)  latest in thread

Message-ID: <3EE8621D.F6A261AE@st.com>
Permalink:  ../3EE8621D.F6A261AE@st.com/
Also on:    postgresql.org/message-id/3EE8621D.F6A261AE@st.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: marco.vezzoli@st.com
  Subject: Re: multiple index search with postgres7.1.3 on solaris 8
  In-Reply-To: <3EE8621D.F6A261AE@st.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox