Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 12th, 2008, 01:55 PM
Newbie
 
Join Date: Aug 2008
Age: 27
Posts: 2
Default Query Tuning for a single select statement

Hi,
This is regarding the query optimization.

T_A table is having rows around 570000, and this query's cost comes out to 202.


SELECT COUNT(1)
FROM T_A
WHERE LOWER(NAME) = LOWER(V_CIName)
AND TYPE_ID = V_CIType_Id

Is there any other way of writing the query to reduce the cost of this.

I am in fix as the cost of such small queries is going very high.

Looking for your co-operation

Thanks & Regards,

Sanjay
Reply
  #2  
Old August 12th, 2008, 03:16 PM
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 6,870
Default

try to create function based index on the desired columns.
Reply
  #3  
Old August 13th, 2008, 05:17 PM
Saii's Avatar
Expert
 
Join Date: Apr 2007
Posts: 130
Default

does TYPE_ID has an index associated to it? composite or simple?
Reply
  #4  
Old August 14th, 2008, 09:58 AM
Newbie
 
Join Date: Aug 2008
Posts: 20
Default

i agree with bedasisa, function index for "LOWER(V_CIName)" will solve your problem
Reply
  #5  
Old August 14th, 2008, 11:06 AM
Newbie
 
Join Date: Aug 2008
Age: 27
Posts: 2
Default

Thanks All for your co- operation and quick response . It works :)
Reply
Reply

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles