database sort vs. programmatic java sort

后端 未结 9 2363
自闭症患者
自闭症患者 2020-12-04 15:28

I want to get data from the database (MySQL) by JPA, I want it sorted by some column value.

So, what is the best practice, to:

  • Retrieve the data from t
9条回答
  •  遥遥无期
    2020-12-04 15:58

    I'm almost positive that it will be faster to allow the Database to sort it. There's engineers who spend a lot of time perfecting and optimizing their search algorithms, whereas you'll have to implement your own sorting algorithm which might add a few more computations.

提交回复
热议问题