Hi Ram,
The problem here is that the inner query (the TRAVERSE) can return a big quantity of record. For each one of these records, the outer query has to invoke the other sub-queries to calculate the LET variable assignments.
The first query can just fetch the first 11 records from the TRAVERSE, the second one has to fetch all the elements from the TRAVERSE (I don't know how many, but probably thousands looking at the response time), calculate the LET for all of them, sort the results and then return the first 11.
As you can see, the difference in performance is definitely justified. There is no way for the execution planner to optimize this query, as the TRAVERSE can return any kind of records
Thanks
Luigi