I’ve got a query which returns 30 rows. I’m writing code that will paginate those 30 rows into 5 records per page via an AJAX call.
-
Is there any reason to return just those 5 records up the presentation layer? Would there be any benefits in terms of speed or does it just get all the rows under the hood anyways?
-
If so, how do I actually do it in Sybase? I know Oracle has Rownum and MS Sql has something similar, but I can’t seem to find a similar function in Sybase.
Unless your record length is huge, the difference between 5 and 30 rows should be completely unnoticeable to the user. In fact there’s a significant potential the multiple DB calls will harm performance more than help. Just return all 30 rows either to your middle tier or your presentation, whatever makes more sense.