Professional Documents
Culture Documents
classification of tables- set and multiset.. set does not store duplicate data,
multiset can store
spces in teradata:
1. permanent space: space allocated for permanent tables, journals, fallback
tables, secondary index sub-tables
this space is not pre-allocated for a db. the total space is divided by the number
of AMPs.
2. spool space: it is the unused space of the permanen space which is reserved to
store intermediate results of a query. if no spool space is available, the user
cannot execute a query
divided by AMPs.
3. temp space: unused permanent space which is used by global temp tables.
divided by AMPs.
indexing concept:
a table can contain only one primary index.
scenarios:
1. primary key and primary index havent been defined.. teradata will check if any
column is unique and make it the unique primary index, else the first column will
be the primary index.
2. primary index has not been defined but the primary key has been defined...
teradata will make the primary key as the unique primary index.
3. primary key and index have been defined, but on different columns.. teradata
will make primary as the unique secondary key
in short, primary index is quite similar to primary key concept for other dbs.
secondary index:
alternate path to the data.
primary index is always faster.
secondary index is faster than a full table scan
there can be a max of 32 secondary indexes on a table
every secondary index creates a sub-table on every amp designed to point to the
primary index row id
there are two types of secondary indexes: unique SI and Non-unique SI
the unique SI is a two-amp operation, while the NUSI is an all-amp operation