But the second call is much longer and has a much different point.  If you
must display the total rows, you need to do the first call anyway.  If you
don't, then use a different component and avoid the first call, only getting
the necessary rows, perhaps plus one to see if there is another page
needed (ala inmethod).

A count call will be very quick.  And it transfers minimal data.

On Wed, Nov 26, 2008 at 12:45 PM, Wayne Pope <
[EMAIL PROTECTED]> wrote:

> > the number of calls itself is meaningless, i dont comprehend why
> > people have a hard time understanding this simple fact.
> >
>
> The point for me is :
>
> something like
> select count(*) from user user1 inner join company com1 on
> user1.company_id=
> com1.id where com1.code='dht2'  - called in size()
> followed by
> select firstName,lastName from user user1 inner join company com1 on
> user1.company_id=com1.id where com1.code='dht2' limit 10 offset 20 -
> called
> in iterator
>
>
> is going to cost more than just:
> select firstName,lastName from user user1 inner join company com1 on
> user1.company_id=com1.id where com1.code='dht2' limit 10 offset 20
> which is all that is needed
>
> hence avoiding 2 calls where 1 will do.
>



-- 
Jeremy Thomerson
http://www.wickettraining.com

Reply via email to