hello, every one, recently i was optimizing web appliaction performance(hibernate: 3, db: mysql5). After use explain to analysis sql, i found mysql didn’t select the proper index, so i want to use force index to make mysql use the right index. but i do not know how to do it? i tried session.createQuery(“select name from user force index(name)”),but not wrok. i also try to extend MySQLDialect to registSQLFunction, not work too.
the error message is :org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: index
please help me, thanks!