What is the acceptable range for skew factor in a table?
There is no particular range for skew factor. In case of production systems, it is suggested to keep skew factor between 5-10.
There are various considerations for skew factor
- Number of AMPS
- Size of row in a table
- number of records in a table
- PI of a table
- Frequent access of table (Performance consideration)
- whether table getting loaded daily /monthly or how frequently data is being refreshed.
***********
What are Restrictions on Views in Teradata?
An index cannot be Created on a view. It cannot contain an ORDER BY clause.
All the derived columns and aggregate columns used in the view must have an AS clause (alias defined).
A view cannot be used to UPDATE if it contains the following :
– Data from more than one table (JOIN VIEW)
– The same column twice
– Derived columns
– A DISTINCT clause
– A GROUP BY clause
**********
What are the scenarios in which Full Table Scans occurs?
1. The where clause in SELECT statement does not use either primary index or secondary index
2. SQL Statement which uses a partial value (like or not like), in the WHERE statement.
3. SQL Statement which does not contain where clause.
4. SQL statement using range in where clause. Ex. (col1 > 40 or col1 < =10000)
*************
Define POSITION Function?
The POSITION function Returns the actual position of the character which occurs first. POSITION function is ANSI standard.Teradata has an equivalent function called INDEX.
Both the POSITION and INDEX functions returns position of character's first occurrence in a string.
Examples for the POSITION function
SELECT POSITION( 'e' IN 'Read'); Displays Result as '2'
SELECT POSITION( 'ad' IN 'Read'); Displays Result as '3'
SELECT POSITION( 's' IN 'Read'); Displays Result as '0'
Examples for the INDEX function.
SELECT INDEX('Write', 'i'); Displays Result as '3'
SELECT INDEX('Write', 'te'); Displays Result as '4'
There is no particular range for skew factor. In case of production systems, it is suggested to keep skew factor between 5-10.
There are various considerations for skew factor
- Number of AMPS
- Size of row in a table
- number of records in a table
- PI of a table
- Frequent access of table (Performance consideration)
- whether table getting loaded daily /monthly or how frequently data is being refreshed.
***********
What are Restrictions on Views in Teradata?
An index cannot be Created on a view. It cannot contain an ORDER BY clause.
All the derived columns and aggregate columns used in the view must have an AS clause (alias defined).
A view cannot be used to UPDATE if it contains the following :
– Data from more than one table (JOIN VIEW)
– The same column twice
– Derived columns
– A DISTINCT clause
– A GROUP BY clause
**********
What are the scenarios in which Full Table Scans occurs?
1. The where clause in SELECT statement does not use either primary index or secondary index
2. SQL Statement which uses a partial value (like or not like), in the WHERE statement.
3. SQL Statement which does not contain where clause.
4. SQL statement using range in where clause. Ex. (col1 > 40 or col1 < =10000)
*************
Define POSITION Function?
The POSITION function Returns the actual position of the character which occurs first. POSITION function is ANSI standard.Teradata has an equivalent function called INDEX.
Both the POSITION and INDEX functions returns position of character's first occurrence in a string.
Examples for the POSITION function
SELECT POSITION( 'e' IN 'Read'); Displays Result as '2'
SELECT POSITION( 'ad' IN 'Read'); Displays Result as '3'
SELECT POSITION( 's' IN 'Read'); Displays Result as '0'
Examples for the INDEX function.
SELECT INDEX('Write', 'i'); Displays Result as '3'
SELECT INDEX('Write', 'te'); Displays Result as '4'
No comments:
Post a Comment