sorting or temporary tables in execution plan?

From: Darren <>
Date: Thu, 21 Aug 2008 12:47:00 -0700 (PDT)
Message-ID: <>

ok, the book I am reading discusses this type of query:

SELECT p.pname
WHERE P.pnum = SH.pnum
AND SH.snum = S.snum
AND = 'NY';

and it compares whether to do the full join first then select, or the other way round.

Anyway the example first joins S and SH over the common column to form a table TempA, and then sorts the table? The sorting actually takes up most of the time >80% of total cost.

Is sorting of a temporary table a necessary step in an execution plan? Received on Thu Aug 21 2008 - 21:47:00 CEST

Original text of this message