-->
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.  [ 1 post ] 
Author Message
 Post subject: Generation of sql query from Criteria API
PostPosted: Wed Oct 12, 2005 11:06 am 
Newbie

Joined: Wed Oct 12, 2005 10:36 am
Posts: 2
Location: Trinec, Czech Republic
hi,
I use Hibernates Criteria API (H2.1.8 and H3.0.5)
database I'm using is MSSQL.
I have a table with more than million of records.
Criteria api generates sql query like this:
Code:
select id as id0_, name as name_0
from tbTable
where (name like ?)

It works well, but it is slow (it think that it wasn't when database was not so big as now)
it is significantly slower than:
Code:
select id as id0_, name as name_0
from tbTable
where (name like 'somename%')

the latter is 12 times faster (in mssql server)
Is it possible to force hibernate to generate these sql queries without '?'
I had a quick look at source code, but I didn't found option like this.

Thank you

Radim Chlad


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.