Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id B48B0475A0C; Wed, 24 Jul 2002 11:18:01 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 4FA0CD610; Wed, 24 Jul 2002 08:18:06 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 434E25C03; Wed, 24 Jul 2002 08:18:06 -0700 (PDT) Date: Wed, 24 Jul 2002 08:18:06 -0700 (PDT) From: Stephan Szabo To: Elielson Fontanezi Cc: 'Daryl Herzmann' , pgsql-sql , pgsql-general Subject: Re: RES: [SQL] Queries not using Index In-Reply-To: Message-ID: <20020724081529.S36103-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200207/1474 X-Sequence-Number: 27961 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.