![](//teradataforum.com/imgs/ptdfw1.gif) |
![](//teradataforum.com/imgs/ptdfw2.gif) |
Archives of the TeradataForum
Message Posted: Thu, 26 Jul 2001 @ 17:24:39 GMT
Subj: | | Re: Import causing all-amp operation |
|
From: | | Geoffrey Rommel |
Perhaps what folks are missing is the meaning of the USING clause. USING forces Teradata to split the request into (1) a parameterized
request parcel (in this case, something like "exec macro1 (?,?,?,?)") and (2) a data parcel which contains the values to be substituted for
the formal parameters. The USING clause tells the Parsing Engine what to put in the data parcel. In the first case, the USING clause is
casting all variables to character:
EXPLAIN
USING
I1 (CHAR(9)),
D1 (CHAR(5)),
I2 (CHAR(10)),
DT2 (CHAR(8))
EXEC MACRO1
(:I1,
:D1,
:I2,
:DT2);
Explanation
-----------------------------------------------------------------------
3) We do an all-AMPs DELETE from testdb.TABLE1 by way of an
all-rows scan.
-> No rows are returned to the user as the result of statement 1.
Thus, the variables in the data parcel are in character form, and Teradata must convert every one of them to numeric in order to do the
comparison.
On the other hand, when you force a type of integer in the USING clause, the data parcel contains integers, so no conversion is
necessary.
W. Geoffrey Rommel
| |