X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 0870BD1B50A for ; Mon, 27 Oct 2003 17:17:41 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 90214-06 for ; Mon, 27 Oct 2003 13:17:10 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id CA9E5D1B8A3 for ; Mon, 27 Oct 2003 13:17:09 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h9RHH9it000401; Mon, 27 Oct 2003 12:17:09 -0500 (EST) To: Rob Messer Cc: pgsql-performance@postgresql.org Subject: Re: Use of multipart index with "IN" In-reply-to: <20031023181831.40095.qmail@web41215.mail.yahoo.com> References: <20031023181831.40095.qmail@web41215.mail.yahoo.com> Comments: In-reply-to Rob Messer message dated "Thu, 23 Oct 2003 11:18:31 -0700" Date: Mon, 27 Oct 2003 12:17:09 -0500 Message-ID: <400.1067275029@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/681 X-Sequence-Number: 4429 Rob Messer writes: > The problem comes in when we are selecting multiple field_name values > in one query. The normal SQL syntax we have been using is like this: > select field_name, option_tag from ds_rec_fld where recid = 3001 and > field_name in ('Q3A1', 'Q3A9'); You'd have better luck if field_name were the first column of the two-column index. See the archives. Improving this situation is on the to-do list but it seems not trivial to fix. regards, tom lane