The performance of the method 7 that involves in recursive CTE depends on the index as well as the nature of the data. Without index, it is running for several minutes. With index it is running fast. But if there are lesser number of distinct values, it runs very fast. For example if we use checksum(newid())%100 in place of checksum(newid())%10000, method 7 outperform every other methods