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
11:47 pm May 20, 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
,
Apr
,
Mar
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
May 2026 Google Search Observations
AdSense Earnings and Observations - May 2026
AI visibility audit
Adsense / Personal Manager / Support
Hacker spoofing as GoogleBot
Page indexed but live url test gets 500 error
Link collaboration strategies
in case you missed it .
Microsoft, AS8075. Google, AS396982.
Bad actor claiming to be OpenAi
Home
Forums Index
Server Side
/
Databases
11:47 pm May 20, 2026