Leszek Gawron wrote:
I lately switched to wicket 1.4. Suddenly my database gets hit 3 times: twice for size and once for actual data.

It gets even worse: one size() query gets executed even BEFORE new filter form values get propagated to filter model:

If I enter some search criteria into datatable's filter form this gets executed:

Hibernate: select count(*) as y0_ from patient this_
Hibernate: select count(*) as y0_ from patient this_ where 
lower(this_.firstname) like ?
Hibernate: select this_.id as id7_4_, this_.address_apartment as address2_7_4_, 
this_.address_building as address3_7_4_, this_.address_city as address4_7_4_, 
this_.address_postalcode as address5_7_4_, this_.address_street as 
address6_7_4_, this_.birthdate as birthdate7_4_, this_.birthplace as 
birthplace7_4_, this_.bloodgroup as bloodgroup7_4_, this_.company_id as 
company31_7_4_, this_.fathersname as fathers10_7_4_, this_.firstname as 
firstname7_4_, this_.height as height7_4_, this_.identitynumber as 
identit13_7_4_, this_.identitytype as identit14_7_4_, this_.insurancenumber as 
insuran15_7_4_, this_.insurancetype as insuran16_7_4_, this_.lastname as 
lastname7_4_, this_.mothersname as mothers18_7_4_, this_.nfz_id as nfz32_7_4_, 
this_.nip as nip7_4_, this_.payer_id as payer33_7_4_, this_.pesel as pesel7_4_, 
this_.phonenumber as phonenu21_7_4_, this_.profession as profession7_4_, 
this_.secondname as secondname7_4_, this_.sex as sex7_4_, this_.supervisor_id 
as supervisor34_7_4_
, this_.temporaryaddress_apartment as tempora25_7_4_, 
this_.temporaryaddress_building as tempora26_7_4_, this_.temporaryaddress_city 
as tempora27_7_4_, this_.temporaryaddress_postalcode as tempora28_7_4_, 
this_.temporaryaddress_street as tempora29_7_4_, this_.weight as weight7_4_, 
company2_.id as id8_0_, company2_.address_apartment as address2_8_0_, 
company2_.address_building as address3_8_0_, company2_.address_city as 
address4_8_0_, company2_.address_postalcode as address5_8_0_, 
company2_.address_street as address6_8_0_, company2_.extendedname as 
extended7_8_0_, company2_.name as name8_0_, company2_.nip as nip8_0_, 
company2_.phonenumber as phonenu10_8_0_, company2_.regon as regon8_0_, 
nfzdepartm3_.id as id4_1_, nfzdepartm3_.code as code4_1_, nfzdepartm3_.name as 
name4_1_, patient4_.id as id7_2_, patient4_.address_apartment as address2_7_2_, 
patient4_.address_building as address3_7_2_, patient4_.address_city as 
address4_7_2_, patient4_.address_postalcode as address5_7_2_, pat
ient4_.address_street as address6_7_2_, patient4_.birthdate as birthdate7_2_, 
patient4_.birthplace as birthplace7_2_, patient4_.bloodgroup as bloodgroup7_2_, 
patient4_.company_id as company31_7_2_, patient4_.fathersname as 
fathers10_7_2_, patient4_.firstname as firstname7_2_, patient4_.height as 
height7_2_, patient4_.identitynumber as identit13_7_2_, patient4_.identitytype 
as identit14_7_2_, patient4_.insurancenumber as insuran15_7_2_, 
patient4_.insurancetype as insuran16_7_2_, patient4_.lastname as lastname7_2_, 
patient4_.mothersname as mothers18_7_2_, patient4_.nfz_id as nfz32_7_2_, 
patient4_.nip as nip7_2_, patient4_.payer_id as payer33_7_2_, patient4_.pesel 
as pesel7_2_, patient4_.phonenumber as phonenu21_7_2_, patient4_.profession as 
profession7_2_, patient4_.secondname as secondname7_2_, patient4_.sex as 
sex7_2_, patient4_.supervisor_id as supervisor34_7_2_, 
patient4_.temporaryaddress_apartment as tempora25_7_2_, 
patient4_.temporaryaddress_building as tempora26_7_2_, pa
tient4_.temporaryaddress_city as tempora27_7_2_, 
patient4_.temporaryaddress_postalcode as tempora28_7_2_, 
patient4_.temporaryaddress_street as tempora29_7_2_, patient4_.weight as 
weight7_2_, patient5_.id as id7_3_, patient5_.address_apartment as 
address2_7_3_, patient5_.address_building as address3_7_3_, 
patient5_.address_city as address4_7_3_, patient5_.address_postalcode as 
address5_7_3_, patient5_.address_street as address6_7_3_, patient5_.birthdate 
as birthdate7_3_, patient5_.birthplace as birthplace7_3_, patient5_.bloodgroup 
as bloodgroup7_3_, patient5_.company_id as company31_7_3_, 
patient5_.fathersname as fathers10_7_3_, patient5_.firstname as firstname7_3_, 
patient5_.height as height7_3_, patient5_.identitynumber as identit13_7_3_, 
patient5_.identitytype as identit14_7_3_, patient5_.insurancenumber as 
insuran15_7_3_, patient5_.insurancetype as insuran16_7_3_, patient5_.lastname 
as lastname7_3_, patient5_.mothersname as mothers18_7_3_, patient5_.nfz_id as 
nfz32_7_3_, p
atient5_.nip as nip7_3_, patient5_.payer_id as payer33_7_3_, patient5_.pesel as 
pesel7_3_, patient5_.phonenumber as phonenu21_7_3_, patient5_.profession as 
profession7_3_, patient5_.secondname as secondname7_3_, patient5_.sex as 
sex7_3_, patient5_.supervisor_id as supervisor34_7_3_, 
patient5_.temporaryaddress_apartment as tempora25_7_3_, 
patient5_.temporaryaddress_building as tempora26_7_3_, 
patient5_.temporaryaddress_city as tempora27_7_3_, 
patient5_.temporaryaddress_postalcode as tempora28_7_3_, 
patient5_.temporaryaddress_street as tempora29_7_3_, patient5_.weight as 
weight7_3_ from patient this_ left outer join company company2_ on 
this_.company_id=company2_.id left outer join nfzdepartment nfzdepartm3_ on 
this_.nfz_id=nfzdepartm3_.id left outer join patient patient4_ on 
this_.payer_id=patient4_.id left outer join patient patient5_ on 
patient4_.supervisor_id=patient5_.id where lower(this_.firstname) like ? order 
by this_.firstname desc limit ?

--
Leszek Gawron

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to