-->
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: Not to parametrize SQL statements
PostPosted: Mon Jun 05, 2006 9:09 am 
Newbie

Joined: Mon Jun 05, 2006 8:51 am
Posts: 18
Hi,
Here's the problem I have (the problem might as well be in me not having read some particular manual, but nontheless).
Is it possible to order NHibernate not to parameterize SQL statements?
The rationale behind this thing is following. Currently, we have around 40M rows in one View, which actually is a Partitioned View, comprised of 4 separate tables. Each table has a constraint on, say, column A (roughly: Table1: 0 < A < 10; Table2: 10 <= A < 20 and so on).
When I try to query this view, generates the following SQL:

Code:
SELECT ....
FROM TableView this
WHERE (this.A = @p0)

@p0 = 5

This code results in a query which scans indices of all 4 tables (at least, Query Analyzer shows this execution plan), instead of scanning index of a single table (which in this case and according to defined constraints should be Table1).
As soon as I replace @p0 in the SQL with actual value of 5, Query Analyzer shows that only one index is about to be scanned.
So the question is: is it possible to override this behaviour?


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