Re: [INTERFACES] Index unused with OR?

From: Teodorescu Constantin <teo(at)flex(dot)flex(dot)ro>
To: pgsql-interfaces(at)postgreSQL(dot)org, mstaedt(at)va-sigi(dot)va(dot)fh-ulm(dot)de
Subject: Re: [INTERFACES] Index unused with OR?
Date: 1998-05-14 13:41:05
Message-ID: 199805141341.QAA02105@flex.flex.ro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Manuel Reiter 1998-05-14 14:11:35 JDBC-driver for postgresql
Previous Message Byron Nikolaidis 1998-05-14 13:20:23 Re: [INTERFACES] ODBC-Interface (PostODBC) and Postgres 6.3.2