TD Practical Notes
TD Practical Notes
AS
PERM = 5368709120, -- 5GB
SPOOL = 5368709120, -- 5GB
TEMPORARY = 2147483648 -- 2GB
NO FALLBACK
NO BEFORE JOURNAL
NO AFTER JOURNAL;
Explanation
------------------------------------------------------------------------
1) First, we do a two-AMP RETRIEVE step in TD_MAP1 from
vkumara.student by way of unique index # 4
"vkumara.student.CONTACT_NO = 2245875" with no residual conditions.
The estimated time for this step is 0.00 seconds.
-> The row is sent directly back to the user as the result of
statement 1. The total estimated time is 0.00 seconds.
Explanation
-----------------------------------------------------------------------
1) First, we lock vkumara.student in TD_MAP1 for read on a reserved
RowHash to prevent global deadlock.
2) Next, we lock vkumara.student in TD_MAP1 for read.
3) We do an all-AMPs RETRIEVE step in TD_MAP1 from vkumara.student by
way of an all-rows scan with a condition of (
"vkumara.student.LAST_NAME = 'PATIL'") into Spool 1 (group_amps),
which is built locally on the AMPs. The size of Spool 1 is
estimated with low confidence to be 2 rows (198 bytes). The
estimated time for this step is 0.00 seconds.
-> The contents of Spool 1 are sent back to the user as the result of
statement 1. The total estimated time is 0.00 seconds.
Explanation
-----------------------------------------------------------------------
1) First, we do a single-AMP RETRIEVE step from vkumara.student by
way of the primary index "vkumara.student.ROLL_NO = 456321" with
no residual conditions into Spool 1 (one-amp), which is built
locally on that AMP. The size of Spool 1 is estimated with low
confidence to be 2 rows (198 bytes). The estimated time for this
step is 0.00 seconds.
-> The contents of Spool 1 are sent back to the user as the result of
statement 1. The total estimated time is 0.00 seconds.
Explanation
-----------------------------------------------------------------------
1) First, we lock VKUMARA.PRODUCT_TABLE in TD_MAP1 for read on a
reserved RowHash in a single partition to prevent global deadlock.
2) Next, we lock VKUMARA.PRODUCT_TABLE in TD_MAP1 for read on a
single partition.
3) We do an all-AMPs RETRIEVE step in TD_MAP1 from a single partition
of VKUMARA.PRODUCT_TABLE with a condition of (
"VKUMARA.PRODUCT_TABLE.ORDER_DATE = DATE '2015-09-01'") with a
residual condition of ("VKUMARA.PRODUCT_TABLE.ORDER_DATE = DATE
'2015-09-01'") into Spool 1 (group_amps), which is built locally
on the AMPs. The size of Spool 1 is estimated with low confidence
to be 1 row (91 bytes). The estimated time for this step is 0.00
seconds.
-> The contents of Spool 1 are sent back to the user as the result of
statement 1. The total estimated time is 0.00 seconds.
Note: If table is more skewed then user may get "no more room in database" error
while inserting data even if there is space available. This is because of HOT AMP
i.e. there is uneven distribution of data and more data is going to single amp which
does not have enough space to handle all data.
SELECT
A.ROLENAME,
A.GRANTEE AS USER_ID,
A.GRANTOR AS ADMIN_ID,
B.DATABASENAME,
B.TABLENAME,
B.GRANTORNAME,
B.ACCESSRIGHT
FROM DBC.ROLEMEMBERS A
JOIN DBC.ALLROLERIGHTS B
ON A.ROLENAME = B.ROLENAME
WHERE GRANTEE=’give_user_id_here‘
GROUP BY 1,2,3,4,5,6,7
ORDER BY 2,1,6;
Teradata Utilities:
Export
string1 ,1, A
string1 ,2, B
string1 ,3, C
string1 ,4, D
string1 ,5, E