It's 1 billion user, and only 1 million unique userid. "求median必须要排序,可以用external sort". What's external sort? Does the below work? 1.) take first 1001, use 501th as the initial median values of login- timing. 2.) read next one and shift the median to fit the new one. 3.) repeat step 2 till the end. (But this one only give the values of timing, not the associated useid)