Paging Decision
-
As all know we use paging when we want to a void return a larg set of records over network so the question is How i know in advance if the query will return many records or not? so using paging or not. I know i can put some logic in my application to prevent the user to run query which my return many record like select all,....... but i can't know in all cases thanks in advance
-
As all know we use paging when we want to a void return a larg set of records over network so the question is How i know in advance if the query will return many records or not? so using paging or not. I know i can put some logic in my application to prevent the user to run query which my return many record like select all,....... but i can't know in all cases thanks in advance
What comes to my mind is doing 2 querys. The first one with COUNT statement, so you'll know how many records will the query have. The second, the query that'll return the records. Paging ? If your application is Web, ASP.NET DataGrid provides Paging functions. I've used them and they worked fine, but my query never returned more than 200 records. :) Free your mind...
-
What comes to my mind is doing 2 querys. The first one with COUNT statement, so you'll know how many records will the query have. The second, the query that'll return the records. Paging ? If your application is Web, ASP.NET DataGrid provides Paging functions. I've used them and they worked fine, but my query never returned more than 200 records. :) Free your mind...
thanks guillermo but i think that executing two query may add extra overload at the server what do you see?
-
thanks guillermo but i think that executing two query may add extra overload at the server what do you see?
If the server performs the query on behalf of the client, it can check first to see how many records were returned in the query (using various means) and then decide if it should return the entire result set to the client. This also gives you central administration of such a threshold.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
thanks guillermo but i think that executing two query may add extra overload at the server what do you see?
Yes there are 2 querys, but both you can make them both work on the same procedure, so it'll be so fast. As both querys will reference the same table and use the same condition, when the second query executes, it'll be on the DB cache. Free your mind...
-
Yes there are 2 querys, but both you can make them both work on the same procedure, so it'll be so fast. As both querys will reference the same table and use the same condition, when the second query executes, it'll be on the DB cache. Free your mind...
THANKS FOR ALL