Issues with pagination and sorting

后端 未结 4 1913
小蘑菇
小蘑菇 2021-02-14 03:44

I\'m looking into situations in database-oriented web applications when one should rely on client side sorting of tables over sorting on the server side. One particular situatio

4条回答
  •  旧巷少年郎
    2021-02-14 04:12

    Databases are true beasts at sorting and selection of data. So your best bet is definitely to have the client say to the server, "I want page X with Y rows sorted by Z." Then the database does its thing, and the client shows the result. To improve performance you could make your client cache results, and furthermore you could make your code request the next and previous pages after the current one has been fetched so that they can be shown instantly on request.

提交回复
热议问题