We are working on a project for optimizing sorting algorithms for SSDs using 
derby.

1)  It is not very clear how the algorithm is implemented for sorting. Are 
there any documents that explain how it is implemented?

I don't know of any Derby-specific documents.

I believe that the basic technique is the one described here:
http://en.wikipedia.org/wiki/External_sorting#External_merge_sort


2)  does any one know how the files are accessed during externalMergeSort?

I believe that the sorter uses the general Store "conglomerate" library
to manage its temporary files, so the files are accessed in mostly the
same way as other Derby storage files. You can see the creation of a
temporary sort file in the code by looking at the code in

  org.apache.derby.impl.store.access.sort.MergeSort

specifically at the method

  createMergeRun()

thanks,

bryan

Reply via email to