Re: Surprising sequence scan when function call used

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Will Fitzgerald" <fitzgerald(at)inetmi(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Surprising sequence scan when function call used
Date: 2000-10-26 03:22:56
Message-ID: 4164.972530576@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Will Fitzgerald" <fitzgerald(at)inetmi(dot)com> writes:
> vdsq=> explain select * from login where login.login = lower('foo');

> Seq Scan on login (cost=0.00..1361.86 rows=609 width=62)

7.0 is a little bit stupid about cross-data-type comparisons (lower()
yields text, not char(n)). This example works OK in current sources,
but until 7.1 comes out you'll need to write something like
where login.login = lower('foo')::char;
Or change the login field to type text...

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Hosokawa Tetsuichi 2000-10-26 04:08:49 Re: Surprising sequence scan when function call used
Previous Message indraneel 2000-10-26 02:54:25 Re: Alternate Database Locations