Costing sorts

Sort cost during sort-merge joins depends on:

These variables affect the number of merge runs required to sort the worktable.