In previous versions of Teradata ARC, CATALOG tables were created with inefficient primary indexes that sometimes caused rows to be skewed on a limited number of AMPS. To correct this, follow these steps to change the primary index of an existing catalog table.
If a new catalog table is created by Teradata ARC, these steps are not necessary.
- Create a new catalog table with the same DDL as the existing table:
CREATE TABLE CATALOGNEW AS CATALOG WITH NO DATA;
- Modify the new catalog table to use the correct primary index:
ALTER TABLE CATALOGNEW MODIFY PRIMARY INDEX(EVENTNUM, DATABASENAME, TABLENAME);
- Copy all data from the existing catalog data to the new catalog table:
INSERT INTO CATALOGNEW SELECT * FROM CATALOG;
- Remove the existing catalog table:
DROP TABLE CATALOG;
- Rename the new catalog table to “CATALOG”:
RENAME TABLE CATALOGNEW AS CATALOG;