Oracle Database and Applications Forum

Go Back   Club-Oracle > Oracle Database and Applications Forum > Oracle Database > SQL PL/SQL

SQL PL/SQL Oracle SQL PL/SQL queries, DML DDL statements, packages, procedures, functions, sequences and triggers


Welcome to Club-Oracle forums, the place to share and learn Oracle technologies. To participate, Create a free account now!



RSS Feed

» Club-Oracle Forums

» Sponsors

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-20-2008, 01:41 PM
magesh_magi1's Avatar
magesh_magi1 magesh_magi1 is offline
Junior Member
 
Join Date: Nov 2008
Posts: 2
Smile Tuning a simple query

Hi ,

Please help me in Tuning a simple query

Code:
Select * from tab1@dblink
where tab1.col1 in ( selct col1 from tab2)

Tab2 is having very less number of records where as Tab1 is having millions of records.
Index is not there in col1 in both the tables where as index is there for some other columns

We cannot join the tables, we may have duplicates in tab2

Tried some Hints but with no Result.

I tried even Driving_site but the results are not drastic..



Thanks,
Mag
Reply With Quote
  #2  
Old 11-20-2008, 04:58 PM
rajavu's Avatar
rajavu rajavu is offline
Forum Advisor
 
Join Date: Oct 2008
Location: @ Bangalore , India
Posts: 121
Default Re: Tuning a simple query

Is there any reason for not having index for field col1.

Anyway try using WHERE EXISTS clause.
__________________

Raj.
Reply With Quote
  #3  
Old 11-21-2008, 05:51 AM
magesh_magi1's Avatar
magesh_magi1 magesh_magi1 is offline
Junior Member
 
Join Date: Nov 2008
Posts: 2
Default Re: Tuning a simple query

Tab2 is in live server, so we cannot add Index to it.
I tried WITH clause , result is not drastic..
Reply With Quote
  #4  
Old 11-21-2008, 06:39 AM
simply_dba's Avatar
simply_dba simply_dba is offline
Member
 
Join Date: Oct 2008
Location: Kolkata, India
Posts: 35
Default Re: Tuning a simple query

What percent of the data is selected in the dataset.?
Can you test the query with the index on col1 on tab1 in a test environment?
Try to implement rajavu's advice
Can you post the statistics of the tables ?
__________________
Some of the world's greatest feats were accomplished by people not smart enough to know they were impossible.
Reply With Quote
  #5  
Old 11-21-2008, 09:21 AM
rajavu's Avatar
rajavu rajavu is offline
Forum Advisor
 
Join Date: Oct 2008
Location: @ Bangalore , India
Posts: 121
Default Re: Tuning a simple query

Quote:
I tried WITH clause , result is not drastic
WITH clause or WHERE EXISTS cluase ?
__________________

Raj.
Reply With Quote
Reply

Bookmarks

Tags
performance tuning, query, simple, tuning


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query Builder in 10g Developer Suite tsil SQL PL/SQL 1 11-11-2008 09:45 AM
SQL PL/SQL Query Optimisation tyro SQL PL/SQL 10 10-30-2008 09:04 AM
SQL Query Help lovelandj SQL PL/SQL 3 10-21-2008 08:49 AM
Oracle Server Tuning Julian Server Administration and Options 2 08-27-2008 04:49 PM

Powered by vBadvanced CMPS v3.0.1



All times are GMT. The time now is 08:24 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Users own Copyright of their content, Rest © club-oracle.com, 2008