Received: from mail.greatbasin.net (mail.greatbasin.net [207.228.35.39]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1M05Ux48305 for ; Wed, 21 Feb 2001 19:05:30 -0500 (EST) (envelope-from jeremy@wellsgaming.com) Received: from [172.16.1.6] (rno-dsl0b-131.gbis.net [216.82.145.131]) by mail.greatbasin.net (8.9.3-MySQL-0.2.3b/8.9.3) with ESMTP id QAA12739 for ; Wed, 21 Feb 2001 16:05:26 -0800 (PST) User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Date: Wed, 21 Feb 2001 16:05:52 -0800 Subject: Using the correct index From: Jeremy Buchmann To: pgsql-admin Message-ID: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Archive-Number: 200102/159 X-Sequence-Number: 761 I have a table I'll call SomeTable that has columns called id, date, and name along with a few others. I created two indexes for this table, one was on id (called SomeTable_id) and the other was on id and date (called SomeTable_id_date). When I do: EXPLAIN SELECT * FROM SomeTable WHERE id = '0101' it tells me: Index Scan using SomeTable_id_date on Sometable ... Even when I do: EXPLAIN SELECT id FROM SomeTable WHERE id = '0101' it still says it's using the SomeTable_id_date index. Why is it using the multicolumn index when the date column isn't involved? -- Jeremy [jeremy@wellsgaming.com]