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: Query caching question
PostPosted: Fri Aug 08, 2008 5:17 pm 
Newbie

Joined: Fri Aug 08, 2008 4:43 pm
Posts: 2
We're using NHibernate 1.2.1.4000 on a shared-tenant SaaS application. The database is our bottleneck, and we're trying to reduce the load on the database. One obvious question comes to mind: NHibernate seems to produce randomly generated column aliases. Are these queries going to be as scalable as stored procs? Will the database be able to cache them efficiently? I'm not a DBA, but I know one...

We're using SQL Server 2005 on Windows 2000 Server.

Thx!


Top
 Profile  
 
 Post subject: Example of the problem
PostPosted: Mon Aug 11, 2008 8:51 am 
Newbie

Joined: Fri Aug 08, 2008 4:43 pm
Posts: 2
Here's an example, perhaps that will help explain the problem:

NHibernate: SELECT top 5 this_.UserId as UserId2_0_, this_.ProjectId as ProjectId2_0_, this_.DisplayName as Display42_2_0_, this_.Password as Password2_0_, this_.EmailAddress as EmailAd44_2_0_, this_.StatusID as StatusID2_0_, this_.LastLoginDate as LastLog46_2_0_, this_.CreatedBy as CreatedBy2_0_, this_.CreatedDate as Created48_2_0_, this_.ModifiedBy as ModifiedBy2_0_, this_.ModifiedDate as Modifie50_2_0_, this_.OnlineVisibilityStatus as OnlineV51_2_0_, this_.OnlineActivity as OnlineA52_2_0_ FROM dbo.Users this_ WHERE this_.ProjectId = @p0 and this_.StatusID = @p1; @p0 = '11111111-1111-1111-1111-111111111111', @p1 = '1'

The items in bold change from one request to another. Does that prevent SQL Server from caching them as the same query? Our DBA says it does...


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.