Re: RES: [SQL] Queries not using Index

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Elielson Fontanezi <ElielsonF(at)prodam(dot)sp(dot)gov(dot)br>
Cc: 'Daryl Herzmann' <akrherz(at)iastate(dot)edu>, pgsql-sql <pgsql-sql(at)postgresql(dot)org>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: RES: [SQL] Queries not using Index
Date: 2002-07-24 15:18:06
Message-ID: 20020724081529.S36103-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql


On Wed, 24 Jul 2002, Elielson Fontanezi wrote:

> Hi!
>
> What kind of index is t2002_06_station_idx?
> Have you done this SELECT command below, right?
>
> select * from t2002_06 WHERE station = 'SAMI4';
>
> This SELECT causes a sequention scan 'cause your index
> is not HASH type, but likely a BTREE one.
> BTREE index is to interval searches (station = 'SAMI4%')
> not precise searchs. (station = 'SAMI4').

Btree indexes are happy being used for equality searches
in PostgreSQL as long as the optimizer thinks it's worth
it. Hash indexes are currently pretty broken, it's better
to just pretend they aren't there.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vince Vielhaber 2002-07-24 15:22:02 Re: Postgres 7.3
Previous Message Robert Treat 2002-07-24 15:10:46 Re: Postgres 7.3

Browse pgsql-sql by date

  From Date Subject
Next Message Daryl Herzmann 2002-07-24 15:45:53 Re: RES: [SQL] Queries not using Index
Previous Message Elielson Fontanezi 2002-07-24 14:41:22 RES: [SQL] Queries not using Index