Order by Operation

Database
KVB
Enthusiast

Order by Operation

Hi

 I have a doubt.Suppose If we mention order by clause in SELECT statement.As per the parallelism concept,each AMP does it's unit of work and it sorts it's own data.But at which place over all data data gets sorted and returns to answer set.I think the below one's.Please correct me if I am wrong.

Once all the results are collected into the spool space then it does the sorting on over all data.

Regards

KVB

4 REPLIES
Enthusiast

Re: Order by Operation

Once all the AMPs sort their porttion of data in their spool, the Message passing layer(Bynet + PDE) Merge all these units to get overall sorting to provide final output.

-Sri

KVB
Enthusiast

Re: Order by Operation

Where does the Spool resides?

Enthusiast

Re: Order by Operation

Across all the AMPs (The actual Space i.e perm space is distributed across all the AMS equally. Unused permspace is used as spool)

Enthusiast

Re: Order by Operation

why not simply use -- explain put_your_sql_text_here; -- to find the answer by yourself?