473,472 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Query Tuning...

15 New Member
table A has 55000 records, Table B has 55 records...

which will be the best join Condition
1.tableA.Column= tableB.column
or
2.tableB.Column= tableA.column


Suggest me a Solution
Dec 6 '07 #1
4 1362
amitpatel66
2,367 Recognized Expert Top Contributor
table A has 55000 records, Table B has 55 records...

which will be the best join Condition
1.tableA.Column= tableB.column
or
2.tableB.Column= tableA.column


Suggest me a Solution

Always place the column of the table with lesser no of records on right hand side of the join.

So your first option will work for you!!
Dec 6 '07 #2
R04
15 New Member
Always place the column of the table with lesser no of records on right hand side of the join.

So your first option will work for you!!
Even then the Query is long Running is there any other Way of Tuning the Query....
Dec 6 '07 #3
Dave44
153 New Member
could you please point out where you found that the right or left side will make the difference? I have never found anywhere that says it will make a difference.

there is a reason there are whole books on query tuning. you want to restrict your dataset as fast as possible, so use your smaller table as your driving table if you are looking for just the 55 rows from both. but either way 55K rows is nothing, what are you doing with the queries? perhaps its not the join but other work being performed during the execution. can we see the table definitions and the query?
Dec 6 '07 #4
amitpatel66
2,367 Recognized Expert Top Contributor
Even then the Query is long Running is there any other Way of Tuning the Query....
Please POST the output of the following for my reference:

Expand|Select|Wrap|Line Numbers
  1. SQL> SET AUTOTRACE TRACEONLY EXPLAIN
  2. SQL> <EXECUTE YOUR QUERY HERE>
  3. SQL> SET AUTOTRACE OFF
  4.  
After you execute your query, it will display the explain plan and cost details of your query. Could you please post those details here for my reference?
Dec 7 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Mahesh Hardikar | last post by:
Hi , Oracle 8.1.7.0.0 on HP-UX 11.0 I am a newbie as far as PL-SQL is concerned . I have Sybase/MSSQL T-SQL background. We have a report which uses a select statement . This select...
14
by: Bob | last post by:
Hi there, Need a little help with a certain query that's causing a lot of acid in my stomach... Have a table that stores sales measures for a given client. The sales measures are stored per...
9
by: majsen | last post by:
Hi, I have problem running this query. It will time out for me... My database are small just about 200 members. I have a site for swaping appartments (rental). my query should look for match in...
6
by: Steven D.Arnold | last post by:
I have a query which does not use column indexes that it should use. I have discovered some interesting behaviors of Postgres which may indicate a bug in the database's query planning. Take a...
1
by: Peter Alberer | last post by:
Hi there, i have a problem with a query that uses the result of a plsql function In the where clause: SELECT assignments.assignment_id, assignments.package_id AS package_id,...
4
by: Raj | last post by:
Hi all, I have couple of questions some one plzz help 1.I have a query which run for 2 hours on my production machine, it returns 1.5 millon rows, i looked at the explain plan it is picking up...
3
by: mleal | last post by:
Does anyone have some more detailed information about how Oracle and MS implement / allow Tuning on Oracle 10g and SQL Server 2005 and the differences between them? Which of them, In a deep...
3
by: dba_222 | last post by:
Dear experts, I hate to ask such a seemingly dumb question. But I have spent some time trying to solve this already to no avail. When I was using my query analyzer last, a few months ago, I...
1
by: Vinod Sadanandan | last post by:
A Roadmap To Query Tuning ============================ For each SQL statement, there are different approaches that could be used to retrieve the required data. Optimization is the process of...
3
by: dunleav1 | last post by:
In 9.1 and 9.5 (Linux 64 bit) when a buffer pool is set to self- tuning, how are blocks configured in respect to blocked vs non-blocked when self-tuning is set to on? (ie) I have one bufferpool...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.