Received: from icebox.venux.net (icebox.venux.net [216.120.166.10]) by hub.org (8.10.1/8.10.1) with ESMTP id e8KIXes63777 for ; Wed, 20 Sep 2000 14:33:40 -0400 (EDT) Received: from doot (cx853045-b.phnx1.az.home.com [24.177.75.28]) by icebox.venux.net (Postfix) with SMTP id 52C7726202 for ; Wed, 20 Sep 2000 14:41:03 -0400 (EDT) Message-ID: <008401c02331$c83e7540$0200000a@doot> From: "Mitch Vincent" To: "pgsql-sql" References: Subject: Re: sql query not using indexes Date: Wed, 20 Sep 2000 11:37:07 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200009/158 I'm curious, I know PG doesn't have support for 'full' text indexing so I'm wondering at what point does indexing become ineffective with text type fields? -Mitch ----- Original Message ----- From: "Stephan Szabo" To: "User Lenzi" Cc: "pgsql-sql" Sent: Wednesday, September 20, 2000 11:23 AM Subject: Re: [SQL] sql query not using indexes > On Wed, 20 Sep 2000, User Lenzi wrote: > > > if I start a query: > > > > explain select * from teste where login = 'xxx' > > results: > > Index Scan using teste1 on teste (cost=0.00..97.88 rows=25 ) > > > > > > however a query: > > explain select * from teste where login > 'AAA' > > results: > > Seq Scan on teste .... > > > > > > On a machine running version 6.5 both queries results index scan. > > > > this results that the version 6.5 is faster than version 7.0.2 on this > > kind of > > query. > > > > > > Any explanation??? > > Have you done a vacuum analyze on the table? Also, what does the row > count for the second query look like? It's probably deciding that > there are too many rows that will match login >'AAA' for index scan > to be cost effective. So, actually, also, what does > select count(*) from teste where login>'AAA" give you on the 7.0.2 box. > > >