Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by hub.org (8.10.1/8.11.0) with ESMTP id e9Q3N2E58797 for ; Wed, 25 Oct 2000 23:23:06 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id e9Q3Mu504167; Wed, 25 Oct 2000 23:22:57 -0400 (EDT) To: "Will Fitzgerald" cc: pgsql-sql@postgresql.org Subject: Re: Surprising sequence scan when function call used In-reply-to: References: Comments: In-reply-to "Will Fitzgerald" message dated "Wed, 25 Oct 2000 13:26:51 -0400" Date: Wed, 25 Oct 2000 23:22:56 -0400 Message-ID: <4164.972530576@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200010/228 X-Sequence-Number: 1895 "Will Fitzgerald" 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