| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Shawn Green (MySQL) | Date: | August 2 2011 6:46pm |
| Subject: | Re: Which is better | ||
| View as plain text | |||
On 8/2/2011 02:41, Adarsh Sharma wrote: > Dear all, > > Just want to know which join is better for querying data faster. > > I have 2 tables A ( 70 GB ) & B ( 7 MB ) > > A has 10 columns & B has 3 columns.Indexes exist on both tables's ids. > > select p.* from table A p, B q where p.id=q.id > > or > > select p.* from table B q , A p where q.id=p.id > > > Thanks > There is no difference in performance. The optimizer will change the sequence it uses to read the tables according to its own rules. If you had used STRAIGHT JOIN to force a particular execution path, the it would normally be faster to read the smaller table first. -- Shawn Green MySQL Principal Technical Support Engineer Oracle USA, Inc. - Hardware and Software, Engineered to Work Together. Office: Blountville, TN
| Thread | ||
|---|---|---|
| • Which is better | Adarsh Sharma | 2 Aug |
| • RE: Which is better | Shafi AHMED | 2 Aug |
| • Too many aliases | hsv | 2 Aug |
| • Re: Too many aliases | Rik Wasmus | 3 Aug |
| • RE: Too many aliases | David Lerer | 3 Aug |
| • RE: Too many aliases | shawn wilson | 3 Aug |
| • RE: Too many aliases | Jerry Schwartz | 4 Aug |
| • Re: Too many aliases | hsv | 4 Aug |
| • RE: Too many aliases | David Lerer | 4 Aug |
| • Re: Too many aliases | Mike Diehl | 4 Aug |
| • Re: Too many aliases | Johnny Withers | 4 Aug |
| • Re: Too many aliases | hsv | 6 Aug |
| • Re: Too many aliases | Johnny Withers | 7 Aug |
| • Re: Which is better | MySQL) | 2 Aug |
| • RE: Which is better | David Lerer | 2 Aug |
| • Re: Which is better | Prabhat Kumar | 2 Aug |
