Bookmark Topic Watch Topic
  • Mark post as helpful
  • send pies
  • Report post to moderator
Avoid Java in-memory sorting for sort indirections

The SQL ORDER BY clause supports many types of expressions, including CASE statements, which can be very useful for sort indirections. For instance, if you want to order your shippings first by some of their status_codes, and only then by text, you can do this:

you should probably never sort data in Java memory because you think that

  • SQL sorting is too slow
  • SQL sorting cannot do it

  • The Cure:

    If you sort any SQL data in memory, think again if you cannot push sorting into your database. This goes along well with pushing paging into the database.


      Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!