Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 20th, 2003, 06:36 AM
a.praveen a.praveen is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 a.praveen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
performance problems

a sample of mY query goes like this:


select

CASE A.SALKEY=466 THEN 1 ELSE 0 END AS SAL

from A,B

WHERE

(A.SALKEY = B.SALKEY OR A.SALKEY = 466)



the query works faster with a simple join ,but with OR conditon it takes lot of time.
with the number of records increasing in A..this query takes more time.

I have made sure all basic indexes exist.


Please help

Reply With Quote
  #2  
Old July 20th, 2003, 07:14 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
What database are you using? The OR clauses will invalidate the use of an index as the data proportionally increases.

Reply With Quote
  #3  
Old July 21st, 2003, 12:21 AM
a.praveen a.praveen is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 a.praveen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for your reply.

I am using oracle 9i.
The OR clauses had been added to cater to requirements.

That is , in the example what i had given i had given only a single join which has a OR clause combined.we have around 4 OR clauses like that combined with a join.

Our requirement is to pick up the most specific combination of all the 4 keys as per the requirements (4 * 4 combinations).

can you please tell any work arounds.

Reply With Quote
  #4  
Old July 21st, 2003, 08:28 AM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
The closer the result set gets to returning a complete subset of the data the more likely the optimizer is to choosing a full table scan over using an index. In general the threshold is 30 percent. Depending on your fields and knowleged of wha the users will be wanting you could create multi column indexes that would span multiple combinations.

Reply With Quote
  #5  
Old July 24th, 2003, 10:07 AM
a.praveen a.praveen is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 a.praveen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Performance

Thanks a lot ,for patiently looking at my doubts and for your answer.It solved our problem

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > performance problems


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 5 hosted by Hostway