From: Teodorescu Constantin <teo@flex.flex.ro>
To: pgsql-interfaces@postgreSQL.org
To: mstaedt@va-sigi.va.fh-ulm.de
Subject: Re: [INTERFACES] Index unused with OR?
Date: Thu, 14 May 1998 16:41:05 +0300
Message-ID: <199805141341.QAA02105@flex.flex.ro> (raw)
In-Reply-To: <199805141321.PAA04595@gate.va.fh-ulm.de>
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
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-interfaces@postgresql.org
Cc: teo@flex.flex.ro, mstaedt@va-sigi.va.fh-ulm.de
Subject: Re: [INTERFACES] Index unused with OR?
In-Reply-To: <199805141341.QAA02105@flex.flex.ro>
* 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