Toggle navigation
Dashboard
Dashboard Tracker
Add / Edit My Forums
System Announcements
Discussion
Active Thread Feed
Top Threads Today
Top Threads This Week
Top Threads Library
Go!
View All
View All
Login
Logout
Home
Forums Index
Server Side
/
Databases
12:05 am Sep 21, 2026
This page requires javascript.
Forum Moderators:
open
Message Too Old, No Replies
Alternative to MySQL IN
gosman
Msg#:4645109
10:02 am on Feb 14, 2014
(gmt 0)
I'm using the following query and it's getting logged to the slow queries log. Is there a more efficient way of retrieving the data.
select SQL_CACHE code,minprice from thetable where code in ('a','b','c','d','e','f') order by minprice
phranque
Msg#:4645148
11:56 am on Feb 14, 2014
(gmt 0)
have you tried using EXPLAIN?
MySQL :: MySQL 5.0 Reference Manual :: 8.2.1 Optimizing Queries with EXPLAIN
:
http://dev.mysql.com/doc/refman/5.0/en/using-explain.html
[dev.mysql.com]
gosman
Msg#:4645323
6:22 pm on Feb 14, 2014
(gmt 0)
I phranque
I have used EXPLAIN and it shows the indexes are used but it's still very slow, 4.8 seconds to return results, that's why I was wondering if there is a more efficient way than using the IN clause.
Join The Conversation
Register
For Free! -
Become a
Pro Member
!
See forum categories
-
Enter the Forum
Moderators and Top Contributors
Moderator List
| Top Contributors:
This Week
,
This Month
,
Aug
,
Jul
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
September 2026 Google Search Observations
AdSense Earnings and Observations - September 2026
An old fashioned desktop WYSIWIG HTML editor
Hit a new milestone today, 1 million requests.
Home
Forums Index
Server Side
/
Databases
12:05 am Sep 21, 2026