Hi,
bin noch ein Anfänger in Sachen Hibernate und habe folgendes Problem:
Wenn das unten aufgeführte SQL über Hibernate zusammengebaut und abgeschickt wird mit den entsprechenden Parametern dauert das ganze ca. 2-3min. Nehme ich das SQL so wie es ist, ersetze die ? durch die entsprechenden Werte und schicke es direkt gegen die DB, dauert es nur wenige Sekunden.
Kann mir jemand sagen, wo da die Ursache liegen könnte?
Danke!
Hibernate version: 3.1.2
Name and version of the database you are using: DB2
The generated SQL (show_sql=true):
select this_.FPNPID as FPNPID5_4_,
this_.FANNAME as FANNAME5_4_,
this_.FANVNAME as FANVNAME5_4_,
this_.FPNGEBNA as FPNGEBNA5_4_,
this_.FPNDGEB as FPNDGEB5_4_,
this_.FANKANRD as FANKANRD5_4_,
this_.FANSTR as FANSTR5_4_,
this_.FANPLZZ as FANPLZZ5_4_,
this_.FANORT as FANORT5_4_,
this_.FNLNR as FNLNR5_4_,
this_.FNLNRVZ as FNLNRVZ5_4_,
this_.FPNKVIP as FPNKVIP5_4_,
this_.FANIDEMA as FANIDEMA5_4_,
suchperson3_.FPNPID as FPNPID10_0_,
suchperson3_.FDZVSNR as FDZVSNR10_0_,
suchperson4_.FPNPID as FPNPID6_,
suchperson5_.FPNPST as FPNPST6_,
suchperson5_.FPNPST as FPNPST9_1_,
suchperson5_.FPNTPST as FPNTPST9_1_,
suchperson5_.FSXSNRT as FSXSNRT9_1_,
snrtyp6_.fsxsnrt as fsxsnrt19_2_,
snrtyp6_.fsxksntb as fsxksntb19_2_,
snrtyp6_.fsuschlt as fsuschlt19_2_,
snrtyp6_.FSXTSNRT as FSXTSNRT19_2_,
snrtyp6_.FSXKEBS as FSXKEBS19_2_,
kvpv1_.FVEVNR as FVEVNR7_,
kvpv1_.FVEVART as FVEVART7_,
kvpv1_.FVEDAVS as FVEDAVS7_,
kvpv1_.FVEVNR as FVEVNR11_3_,
kvpv1_.FVEVART as FVEVART11_3_,
kvpv1_.FVEDAVS as FVEDAVS11_3_,
kvpv1_.FVEDBVS as FVEDBVS11_3_
from YPO01010 this_
left outer join YPO07010 suchperson3_ on this_.FPNPID=suchperson3_.FPNPID
left outer join YPO05010 suchperson4_ on this_.FPNPID=suchperson4_.FPNPID
left outer join YPO30010 suchperson5_ on suchperson4_.FPNPST=suchperson5_.FPNPST
left outer join YBP04010 snrtyp6_ on suchperson5_.FSXSNRT=snrtyp6_.fsxsnrt
left outer join YVS23010 kvpv1_ on this_.FPNPID=kvpv1_.FVEVNR
where this_.FANNAME=?
and this_.FANPLZZ between ? and ?
and (this_.fnlnr IN (SELECT fnlnr FROM ybo54010 a WHERE a.fnlnru = ?)
or this_.fnlnrvz IN (SELECT fnlnr FROM ybo54010 a WHERE a.fnlnru = ?))
order by this_.FANNAME asc,
this_.FANVNAME asc,
this_.FPNPID asc,
kvpv1_.FVEDAVS desc
|