Prepare for your Next Interview
This is a discussion on Sql join performance Query within the Database Design forums, part of the Databases category; I have a sql join 3 tables, like this: select * from tableA a left join tableB b on a.id1 = b.id1 left join tableC c on b.id2 = c....
|
|||
|
Sql join performance Query
I have a sql join 3 tables, like this:
select * from tableA a left join tableB b on a.id1 = b.id1 left join tableC c on b.id2 = c.id2 It works with the correct result, but takes so long time. For example, in each table, there is about 300 rows --> the above query takes ~ 20 seconds. Does anyone know how to improve in this case? |
| Sponsored Links |
|
|||
|
Re: Sql join performance Query
Quote:
The very purpose of the left outer join is to get the records meets the join condition + rest of the rows from left table. The left most table will the table that he wants to get all the records whether it satisfies the join condition or not. Changing the smaller table as left most table may not serve its purpose. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Outer Join Query Example | mailtos.ravi | SQL | 4 | 03-05-2008 03:34 AM |
| Query Performance | krishnaindia2007 | Oracle | 4 | 12-12-2007 03:21 AM |
| calculating the sum of a field in a query with join | 3roses | Oracle | 2 | 09-05-2007 12:17 PM |
| Writing query with LEFT OUTER JOIN | N SRIRAM K | Data Warehousing | 5 | 09-03-2007 05:08 AM |
| Join Query without using NOT IN subquery | Geek_Guest | SQL | 1 | 03-07-2007 03:24 PM |