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?