All Forums Database
Kishore_1 208 posts Joined 03/10
03 Jun 2011
How do we calculate MAX in teradata


I have a salary_table and I want to fetch the maximum of Net_Amt from that.
I want to know how does teradata get this maximum value.So I get the explain plan which is as follows:

sel max(Net_Amt) from dbname.salary_table;
------------------------------------------------------ --------------------------
1) First, we lock a distinct dbname."pseudo table" for read on a
RowHash to prevent global deadlock for dbname.salary_table.
2) Next, we lock dbname.salary_table for read.
3) We do an all-AMPs SUM step to aggregate from
dbname.salary_table by way of an all-rows scan with no
residual conditions. Aggregate Intermediate Results are computed
globally, then placed in Spool 3. The size of Spool 3 is
estimated with high confidence to be 1 row (23 bytes). The
estimated time for this step is 0.03 seconds.
Can any one explain what does " all-AMPs SUM step to aggregate from dbname.salary_table" mean in step 3.

Thanks in Advance,

Dixxie 58 posts Joined 12/10
03 Jun 2011

The step 3 is make in parallel mode in all AMPs, then those partial results are put in the spool 3 and finally find here the max amount.


You must sign in to leave a comment.