Hard to tell. It depends on the cardinality of tables' id (I assume the IDs are not unique in each of the tables). David.
-----Original Message----- From: Shawn Green (MySQL) [mailto:shawn.l.gr...@oracle.com] Sent: Tuesday, August 02, 2011 2:47 PM To: Adarsh Sharma Cc: mysql@lists.mysql.com Subject: Re: Which is better 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 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=dle...@us.univision.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org