I have a project where I have to sort a list of messages. Basically these are messages placed somewhere with gps positions. I have an id field a message field (blob) longitude latitude ownertype and userrating. The point is to sort these messages according to ownertype and userrating. ownertype is a tinyint and userrating is an int. The question is, is it better to just get all the relevant messages joined with the users and then order it in java , or is it better to do an order by clause in your sql statement.
I forgot to add a couple of things. There are going to be thousands of request a minute but the rows returned could potentially reach a hundred.
databases are excellent at sorting and retrieving sets. – let it do that for you.