Sorting on the server or on the client?

前端 未结 10 648
一生所求
一生所求 2020-12-04 22:31

I had a discussion with a colleague at work, it was about SQL queries and sorting. He has the opinion that you should let the server do any sorting before returning the rows

10条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 23:00

    If the sorting is just cosmetic and the client is getting the entire set of data I would tend to let the client handle it as it is about the presentation.

    Also, say in a grid, you may have to implement the sorting in the client anyway as the user may change the ordering by clicking a column header (don't want to have to ask the server to retrieve all the information again)

提交回复
热议问题