sorting or temporary tables in execution plan?

From: Darren <anon5874_at_yahoo.com>
Date: Thu, 21 Aug 2008 12:47:00 -0700 (PDT)
Message-ID: <8401e5b7-bdc7-479c-b8dd-be5f184e37c6_at_56g2000hsm.googlegroups.com>



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

SELECT p.pname
FROM P, SH, S
WHERE P.pnum = SH.pnum
AND SH.snum = S.snum
AND S.city = '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