Connecting Tech Pros Worldwide Help | Site Map

Using IN or OR

Newbie
 
Join Date: Nov 2008
Posts: 1
#1: Nov 26 '08
in MySQL queries, which one is more performance optimized between IN and OR operators.
mwasif's Avatar
Moderator
 
Join Date: Jul 2006
Location: Pakistan
Posts: 718
#2: Nov 26 '08

re: Using IN or OR


I don't think there is any performance difference.
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,739
#3: Nov 26 '08

re: Using IN or OR


Everything in MySQL is optimized for performance. I doubt it very very much that minor syntax differences like these would affect the performance.

You could always simply try them both out and see for yourself.
mwasif's Avatar
Moderator
 
Join Date: Jul 2006
Location: Pakistan
Posts: 718
#4: Nov 27 '08

re: Using IN or OR


You can use EXPLAIN to compare the performance of both the queries.
Reply

Tags
performance, query, using in, using or