This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Design question when using JDBC

 
Michael Boehm
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making an application which retrieves information from a MySQL database. This information can be sorted by different properties. What factors should one consider in order to make a reasonable choice between doing the sorting at the database level and doing it at the application level ?
 
Rob Spoor
Sheriff
Pie
Posts: 20751
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Speed comes to mind. Sometimes it's faster to sort in the database engine, sometimes it's faster to sort in the application.
Another aspect to take into account is memory: in order to be able to sort in the application, you first need to collect all records. That means that they all will reside in memory. If you sort in the database you may only need to store the last record, or last few (depending on the application of course).
 
Campbell Ritchie
Sheriff
Posts: 51422
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This thread would sit better in our databases forum. Moving.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic