From: Tom Lane <tgl@sss.pgh.pa.us>
To: Will Fitzgerald <fitzgerald@inetmi.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Surprising sequence scan when function call used
Date: Wed, 25 Oct 2000 23:22:56 -0400
Message-ID: <4164.972530576@sss.pgh.pa.us> (raw)
In-Reply-To: <KPELIDPNOGGPCLGOMDLFOEIKCDAA.fitzgerald@inetmi.com>
References: <KPELIDPNOGGPCLGOMDLFOEIKCDAA.fitzgerald@inetmi.com>
"Will Fitzgerald" <fitzgerald@inetmi.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, fitzgerald@inetmi.com
Subject: Re: Surprising sequence scan when function call used
In-Reply-To: <4164.972530576@sss.pgh.pa.us>
References: <KPELIDPNOGGPCLGOMDLFOEIKCDAA.fitzgerald@inetmi.com> <4164.972530576@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox