Reputation: 609
I'm interested in the top two sortings in this screen shot. The column uniqid#2509 are in both sorting. Does this sorting
+- *Sort [uniqid#2509 ASC NULLS FIRST, __$start_lsn#2483 DESC NULLS LAST, __$seqval#2484 DESC NULLS LAST], false, 0
benefit from the second sorting
:- *Sort [uniqid#2509 ASC NULLS FIRST], false, 0
or the column uniqid#2509 is sorted twice?
Thanks
Upvotes: 0
Views: 257
Reputation: 1054
The first sort(from the bottom) is a reducer side sort of the mapper data.
In a Sort merge join, once the data is partitioned based on the hash key, it is sorted on the reducer side, to perform a sort-merge join.
In this case, it will benefit, not because of the sort but because of the sort-merge join.
Upvotes: 1