You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
firstResult/maxResults specified on polymorphic query; applying in memory!
... quite often with queries having set a MaxRows row selection on a base entity class of polymorphic nature.
There are situations where it is absolutely correct to warn in such a case:
some results should be skipped with set FirstResult: the skipped records need to be calculated in memory
the query has an order by clause: the ordering is not handled correctly
In my case, I have the situation where I want to check if there are entities for a certain criteria or I just want to find some of them as a worklist for now. I don't care about sort order (there is no order by clause in the query).
In this case I would expect
to get the query translators are evaluated step by step until I reach the MaxRows limit
to not get a warning
In each iteration over the translators, we can calculate the maximum number of to-be-fetched rows as the difference between the total MaxRows and the already fetched rows. Additionally, I would like to change the includedCount variable to be zero-based and not minus-one-based because that's counterintuitive.
The text was updated successfully, but these errors were encountered:
csharper2010
added a commit
to csharper2010/nhibernate-core
that referenced
this issue
Feb 26, 2025
HQLQueryPlan for polymorphic query:
* Calculate a row selection in with the remaining number of rows as MaxRows
* Warn only in cases where correctness or performance may suffer
* Make includedCount zero-based
csharper2010
added a commit
to csharper2010/nhibernate-core
that referenced
this issue
Feb 26, 2025
HQLQueryPlan for polymorphic query:
* Calculate a row selection in with the remaining number of rows as MaxRows
* Warn only in cases where correctness or performance may suffer
* Make includedCount zero-based
Currently, we get the warning...
... quite often with queries having set a
MaxRows
row selection on a base entity class of polymorphic nature.There are situations where it is absolutely correct to warn in such a case:
FirstResult
: the skipped records need to be calculated in memoryIn my case, I have the situation where I want to check if there are entities for a certain criteria or I just want to find some of them as a worklist for now. I don't care about sort order (there is no order by clause in the query).
In this case I would expect
MaxRows
limitIn each iteration over the translators, we can calculate the maximum number of to-be-fetched rows as the difference between the total
MaxRows
and the already fetched rows. Additionally, I would like to change theincludedCount
variable to be zero-based and not minus-one-based because that's counterintuitive.The text was updated successfully, but these errors were encountered: