db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryce Nesbitt <bry...@obviously.com>
Subject Getting optimizer hints to mysql through Torque (USE INDEX)
Date Thu, 29 Mar 2007 06:39:01 GMT
I don't hold out much hope: but can I pass mysql optimizer hints through
torque?  I've got a query that is much faster with USE INDEX:

SELECT * FROM CCS_ASSIGNMENT USE INDEX(IDX_STOP)
WHERE CCS_ASSIGNMENT.START<='20070331000000'
AND CCS_ASSIGNMENT.STOP>='20070328000000'
AND CCS_ASSIGNMENT.POD_ID=13;

Without a hint, the mysql optimizer chooses the POD_ID index, when the
STOP index would be better.   Is there a way to convince Torque to pass
through the relevant bit of SQL?

The above query is from torque 3.0-b4, with the USE INDEX() added. 
Criteria.CUSTOM won't work in this case.

http://www.obviously.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message