i have the exact same behaviour and i do not see why this should be.
The first query does this:
Code:
NHibernate :select persoon0_.SubjectNr as SubjectNr0_, inkomens1_.SUBJECTNR as SUBJECTNR1_, inkomens1_.SUBJECTNRWERKG as SUBJECTN2_1_, inkomens1_.SOORT as SOORT1_, inkomens1_.Periodiciteit as Periodic4_1_, inkomens1_.categorie as categorie1_, inkomens1_.SubjectNr as SubjectNr__, inkomens1_.SUBJECTNR as SUBJECTNR__, inkomens1_.SUBJECTNRWERKG as SUBJECTN2___, inkomens1_.SOORT as SOORT__, inkomens1_.Periodiciteit as Periodic4___ from personen persoon0_ inner join inkomens inkomens1_ on persoon0_.SubjectNr=inkomens1_.SubjectNr where (inkomens1_.categorie=4)or(inkomens1_.SOORT=110)
then I see thousands of calls:
Code:
NHibernate :SELECT persoon0_.SubjectNr as SubjectNr0_ FROM personen persoon0_ WHERE persoon0_.SubjectNr = :p0
(which seem useless :evil: )
then again thousands of calls:
Code:
NHibernate :SELECT periods0_.Subjectnr as Subjectnr__, periods0_.SUBJECTNRWERKG as SUBJECTN2___, periods0_.SOORT as SOORT__, periods0_.Periodiciteit as Periodic4___, periods0_.SUBJECTNR as SUBJECTNR__, periods0_.TijdslijnID as Tijdslij5___, periods0_.SUBJECTNR as SUBJECTNR1_, periods0_.SUBJECTNRWERKG as SUBJECTN2_1_, periods0_.SOORT as SOORT1_, periods0_.Periodiciteit as Periodic4_1_, periods0_.TijdslijnID as Tijdslij5_1_, periods0_.Categorie as Categorie1_, periods0_.Dtafvoer as Dtafvoer1_, periods0_.Dtopvoer as Dtopvoer1_, periods0_.Status as Status1_, periods0_.Dteinde as Dteinde1_, periods0_.Dtbegin as Dtbegin1_, periods0_.Geldig as Geldig1_, periods0_.SubjectNr as SubjectNr1_, periods0_.Afgeleid as Afgeleid1_, periods0_.BedragNetto as BedragN15_1_, periods0_.BedragBruto as BedragB16_1_, periods0_.BelastbaarLoon as Belastb17_1_, periods0_.Kleur as Kleur1_, periods0_.BijzonderTarief as Bijzond19_1_, periods0_.ReserveringVT as Reserve20_1_, periods0_.kenmerkwerkg as kenmerk21_1_, periods0_.HeffingsKorting as Heffing22_1_, periods0_.Kenmerkwerkg as Kenmerk23_1_, periods0_.hoogte as hoogte1_, inkomen1_.SUBJECTNR as SUBJECTNR0_, inkomen1_.SUBJECTNRWERKG as SUBJECTN2_0_, inkomen1_.SOORT as SOORT0_, inkomen1_.Periodiciteit as Periodic4_0_, inkomen1_.categorie as categorie0_ FROM inkomen periods0_ left outer join inkomens inkomen1_ on periods0_.SubjectNr=inkomen1_.SUBJECTNR and periods0_.SUBJECTNRWERKG=inkomen1_.SUBJECTNRWERKG and periods0_.SOORT=inkomen1_.SOORT and periods0_.Periodiciteit=inkomen1_.Periodiciteit WHERE periods0_.Subjectnr = :p0 AND periods0_.SUBJECTNRWERKG = :p1 AND periods0_.SOORT = :p2 AND periods0_.Periodiciteit = :p3 and periods0_.status > -2
It seems this could have been alot more efficient. I'm using Oracle9 dialect and outer-joining is not disabled.
Is there something that could be done about this?