Re: Problem with lower() function

From: Yuva Chandolu <ychandolu(at)ebates(dot)com>
To: Yuva Chandolu <ychandolu(at)ebates(dot)com>, "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problem with lower() function
Date: 2002-08-09 23:49:50
Message-ID: A0F24737FCB34F489EC955D143BDD8510173E12E@exchange-sf1.corp.ebates.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thank you, we figured out that, the query with lower() is taking too long
and we thought it is having some problem. The actual table in our database
has more than 10 million rows and query is taking too long.

Thanks
Yuva

-----Original Message-----
From: Yuva Chandolu
Sent: Friday, August 09, 2002 3:41 PM
To: 'pgsql-hackers(at)postgresql(dot)org'
Subject: [HACKERS] Problem with lower() function

Hi, We have a problem with lower() function working differently for two
different data types

table: yuva_test
column_name data_type
yt_name1 varchar(255)
yt_name2 char(1)

The data is
yt_name1 yt_name2
yuva F
bharat F
1234556 F
234 F

etc.

When we run the query "select * from yuva_test
lower(yt_name1)=lower('1234556') and lower(yt_name2)=lower('F')" it takes
forever to return, but if try "select * from yuva_test yt_name1='1234556'
and lower(yt_name2)=lower('F')" it returns immediately.

What is happenning here? Why lower behaving differently for varchar(255) and
char(1), and how to make first query to work without changing schema.

Thanks
Yuva

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

Browse pgsql-hackers by date

  From Date Subject
Next Message Scott Shattuck 2002-08-09 23:59:31 strange performance anomalies
Previous Message Rod Taylor 2002-08-09 23:46:28 Re: Proposal: stand-alone composite types