|
|
Archives of the TeradataForum
Message Posted: Tue, 18 Nov 2003 @ 21:01:36 GMT
Subj: | | Re: Join Index usage |
|
From: | | Ballinger, Carrie |
This answer is for "The related question" under this thread...
An access lock applied to a base table will be passed on to the join index, if the join index is selected for use instead of using the
base table. Here is an example of a row level access lock being applied against the base table, but used by a join index. You can validate
in the explain text that this is happening.
create join index CustNameJI
as select
c_name,c_acctbal,c_mktsegment,c_range
from customer
primary index(c_name);
explain
locking row for access
Select c_acctbal, c_mktsegment, c_range
from customer
where c_name = 'Customer#000000999' ;
Explanation
1) First, we do a single-AMP RETRIEVE step from CAB.NAMEJI by way of the pri-mary index "CAB.NAMEJI.C_NAME = 'Customer#000000999'" with a
residual con-dition of ("CAB.NAMEJI.C_NAME = 'Customer#000000999'") into Spool 1, which is built locally on that AMP. The input table will
not be cached in memory, but it is eli-gible for synchronized scanning locking row for access. The size of Spool 1 is es-timated with high
confidence to be 1 row.
| |