These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: using MySQL's IGNORE INDEX through Hibernate
PostPosted: Tue Aug 21, 2007 2:19 pm 
Newbie

Joined: Tue Aug 21, 2007 2:12 pm
Posts: 1
I'm using Hibernate 3.2 and MySQL5.0 and need to use the 'IGNORE INDEX (indexName)' syntax because MySQL's query optimizer is choosing the wrong index for a number of queries.

I have tried to use Hibernate's Dialect.registerKeyword and registerFunction methods to enable this, but I haven't had any luck.

I keep getting 'unexpected token: IGNORE near line 1, column 57' errors.

Is there any way to make use of the IGNORE INDEX syntax through Hibernate? Or am I stuck?

Thanks,

Rick


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 21, 2007 11:40 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
I believe that you have to use SQL (not HQL) for that type of problem (index hints). That's what we are doing, at least, because I was unable to find a way to do it through HQL.

_________________
nathan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.