Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Monday, 25 August 2014

PRIMARY INDEX in Teradata

Primary index is used to distribute the data on all the AMP’s.

While creating table, PRIMARY INDEX is mandatory in Teradata. When we try to creating a table in Teradata, Teradata will look whether primary index specified. If the index is not specified, secondly it will look for Primary key constraint to make the primary index. If you have not specified primary index or primary constraints then Teradata always take first column as a primary index. It’s always good to provide primary index while creating a table as its helps Teradata to spread the data on all the AMP’s.

CREATE MULTISET TABLE EMPLOYEE
(
EMPNO INT,
EMPNAME VARCHAR(500)
DEPT VARCHAR(20)
)
PRIMARY INDEX(EMPNO); 

please note:- Above we have created multiset table.


Read Also:-  

No comments:

Post a Comment

Please provide your feedback in the comments section above. Please don't forget to follow.