What did you use to sort these 10 million lines?
Specific command:
LC_ALL=c sort -n filename -r > output
k2,2
have been faster, as it limits to just the second field?How large was the 10 million line file, and do you know whether sort was paging files to disk?
Used these commands:
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 10000000 > text
cat /dev/urandom | od -DAn |tr -s ' ' '\n' |head -10000000 | sed -e 's/$/\/9.0/'> num
bc -l num > num2
(that's to create decimal numbers)
paste -d, text num2 > textfirst
paste -d, num2 text > numfirst
time LC_ALL=c sort -n numfirst -r > output
real 0m10.712s user 0m21.959s sys 0m1.644s
time LC_ALL=C sort --field-separator=',' -k2 -n -r textfirst > output
real 0m9.638s user 0m21.940s sys 0m1.293s