I think it's to have the web page say "showing 20 results" and  links for "page 
2, page 3" etc.?

> On Sep 22, 2016, at 5:46 AM, Emmanuel Lécharny <elecha...@gmail.com> wrote:
> 
>> Le 22/09/16 à 10:42, Doan Tin Nghia a écrit :
>> Thanks. I need it for paging (same issue like
>> https://sourceforge.net/p/ldap-sdk/mailman/message/29370418/)
> 
> Ok, but let me ask you aain : why do you technically need to know how
> many entries you will get ?
> 
> This information is totally spurious, unless you want to tell your
> client "you are going to get 1 238 654 entries".
> 
> Most of the time, and I saw that many, many times by people trying to
> implemented an web page with back and forth buttons, the answer is "But,
> but, but, I *NEED* to know how many elements I wil get in order to
> correctly design my web page, otehrwise I will not be able to know if I
> will have a next page !!!". This is typically wrong. If you decide to
> show N elements in one page, and have a Next button, then just poll 2xN
> elements from the backend, and if you get more than N elements, you know
> that you will have a Next button.
> 
> FTR, those using a RDBMS are frequently doing a selectcount(*) before
> doing the real select for the exact same reason, and this is STUPID :
> they are doing the exact same request *TWICE*, overloading teh server.
> Be smart.
> 

Reply via email to