Received: from flex.flex.ro (flex.flex.ro [193.230.255.2]) by hub.org (8.8.8/8.7.5) with ESMTP id JAA25137 for ; Thu, 14 May 1998 09:42:08 -0400 (EDT) Received: (from teo@localhost) by flex.flex.ro (8.8.8/8.7.3) id QAA02105; Thu, 14 May 1998 16:41:05 +0300 Date: Thu, 14 May 1998 16:41:05 +0300 From: Teodorescu Constantin Message-Id: <199805141341.QAA02105@flex.flex.ro> To: pgsql-interfaces@postgreSQL.org, mstaedt@va-sigi.va.fh-ulm.de Subject: Re: [INTERFACES] Index unused with OR? In-Reply-To: <199805141321.PAA04595@gate.va.fh-ulm.de> X-Status: NU X-Mailer: Applixware 4.3 (807.141.90) The index is used only if scanning the index is faster than scanning the table itself. Trying the index only with a couple of records isn't good. Try inserting some hundred records inside and VACUUM the database after. When you vacuum the database you are updating the statistics table used by the query optimizer. The query optimizer will choose to use an index when it found that it worths. Not using the index in OR queries was some-time ago a bug in PostgreSQL 6.1 if my memory is good. Think that has been solved in new releases, am I wrong ? Constantin Teodorescu FLEX Consulting Braila, ROMANIA