MySQL Forums
Forum List  »  Performance

Re: 2 small queries vs 1 big
Posted by: Roman Ivanov
Date: August 28, 2005 12:34PM

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

Could you please explain why? Is it because of the query overhead?

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

I'm usually coding in PHP, so I always quote my values to prevent possible sql injection attacks. Does quoting numbers have some negative effect?

Options: ReplyQuote


Subject
Views
Written By
Posted
2344
August 27, 2005 12:46PM
1621
August 28, 2005 02:42AM
Re: 2 small queries vs 1 big
1435
August 28, 2005 12:34PM
1654
August 28, 2005 01:58PM
1410
August 30, 2005 08:15AM
1435
August 30, 2005 08:27AM
1497
August 30, 2005 05:50PM
1482
August 31, 2005 03:20AM
1573
September 07, 2005 11:56AM
1738
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.