DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old April 18th, 2007, 01:52 PM
prabasuresh prabasuresh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 prabasuresh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 44 sec
Reputation Power: 0
COALESCE function in where clause

Query with coalesce function takes less time than other queries. below is the one select query which takes 20k timerons

select * FROM tablea a
WHERE SOUNDEX( a.lastname) = SOUNDEX('pim') AND SOUNDEX( firstname) = SOUNDEX('tim')

when I add some meaning less coalesce function with 'where ' clause, it is taking less time. below is the select query with coalesce function which takes 14k timerons.

select * FROM tablea a
WHERE SOUNDEX( a.lastname) = SOUNDEX('pim') AND SOUNDEX( firstname) = SOUNDEX('tim')
and a.lastname= coalesce(a.lastname, a.lastname)

Can somebody explain how the above query taking less time than the first one. appreciate your help.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > Coalesce function in where clause


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway