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
7:47 pm Jul 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
,
Jun
,
May
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
July 2026 Google Search Observations
Annoying Crawler, Bot, or what?
Suspicious visitors
Do you still build external links in 2026?
How to find out why a page is suddenly popular?
Home
Forums Index
Server Side
/
Databases
7:47 pm Jul 21, 2026