Scan function ( ) { Scan loc0 = p . open ( ) ; List < TempTable > loc1 = splitIntoRuns ( loc0 ) ; loc0 . close ( ) ; while ( loc1 . size ( ) > 2 ) loc1 = doAMergeIteration ( loc1 ) ; return new SortScan ( loc1 , comp ) ; }
this method is where most of the action is . up to 2 sorted temporary tables are created , and are passed into sortscan for final merging . concode_field_sep Plan p concode_elem_sep RecordComparator comp concode_elem_sep Transaction tx concode_elem_sep Schema sch concode_field_sep Schema schema concode_elem_sep List<TempTable> splitIntoRuns concode_elem_sep int blocksAccessed concode_elem_sep int distinctValues concode_elem_sep int recordsOutput concode_elem_sep boolean copy concode_elem_sep List<TempTable> doAMergeIteration concode_elem_sep TempTable mergeTwoRuns