Snippet IT IT News, Programming, Internet and Blogging

12Apr/090

Java: Randomly sort values in a array (the generic way) in single pass

Few years back (yes, about 4 years back), I wrote an article about randomly sort query results in MySQL. The main problem in randomly sort query results is that when you have a very large data in your database and the statement to sort the result may change the data execution plan causing DMBS does not choose the right plan. Therefore, sometime it is more wise to sort it in your own program instead of too depending on DBMS's decision which may affect the overall performance of a program.