-->
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.  [ 4 posts ] 
Author Message
 Post subject: Query performance
PostPosted: Fri May 27, 2005 5:23 am 
Newbie

Joined: Fri May 27, 2005 4:49 am
Posts: 4
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="org.hibernate.test.Product" table="t$Product" lazy="false">
<id type="long" name="id" column="id$">
<generator class="identity"/>
</id>
<property name="vendor" type="string" length="254">
<column name="vendor" index="idx_product_ven_nam_ver"/>
</property>
<property name="name" type="string" length="254">
<column name="name" index="idx_product_ven_nam_ver"/>
</property>
<property name="version" type="string" length="64">
<column name="version" index="idx_product_ven_nam_ver"/>
</property>
<property name="category" type="string" length="64"/>
<property name="helplink" type="string" length="254"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():

Query q_product=s.createSQLQuery("select {p}.id$ as {p.id} from t$Product {p} where {p}.vendor=? and {p}.name=? and {p}.version=?","p",Product.class).setFirstResult(0).setMaxResults(1).setCacheable(true).setCacheRegion("frontpages");

q_product.setString(0,"Vendor");
q_product.setString(1,"Name");
q_product.setString(2,"Version");
Product product=(Product)q_product.uniqueResult();

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

Quote:

In the above query, I am experiencing a serious performance degradation (about 4 times slower) with hibernate compared to JDBC ?. Is there a better way to query? or is there problem in mapping? pl help


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 28, 2005 8:16 pm 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
see http://www.hibernate.org/157.html


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 30, 2005 2:36 am 
Newbie

Joined: Fri May 27, 2005 4:49 am
Posts: 4
Read through the article suggested. But i am anxious to know the exact changes.

Say for eg: W.r.t to STORM benchmark, what were the initial and final hbm.xml and what "parameters" were changed where and howmuch?.

I would really appreciate if u could relate to the example that i have refered..

Could u please helpme.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 30, 2005 9:20 am 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
read the faqs.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.