MySQL Forums
Forum List  »  Performance

Re: 2 small queries vs 1 big
Posted by: Roland Bouman
Date: August 28, 2005 02:42AM

(I suppose that in the 2 query version, you'd compare the g.id to the value of the u.groupId you just retrieved from the first query to obtain the a result equivalent to that of the join)

Assuming you've got indexes for the id columns, the single join solution will most certainly be faster than the two query version.

BTW what is the datatype of u.id and g.id? If its a numeric type you shouldn't quote your value.

Options: ReplyQuote


Subject
Views
Written By
Posted
2351
August 27, 2005 12:46PM
Re: 2 small queries vs 1 big
1623
August 28, 2005 02:42AM
1439
August 28, 2005 12:34PM
1655
August 28, 2005 01:58PM
1412
August 30, 2005 08:15AM
1439
August 30, 2005 08:27AM
1498
August 30, 2005 05:50PM
1484
August 31, 2005 03:20AM
1576
September 07, 2005 11:56AM
1741
September 07, 2005 01:43PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.