Please tell me a query to find the Primary key,Foreign
key,primary Index,PPI for the Database?
Answers were Sorted based on User's Feedback
Answer / bhanu prasad
We can find the information of all the indexes in the
system table "dbc.indices"
| Is This Answer Correct ? | 19 Yes | 4 No |
Hi Parsad,
I hope by running below query you'll get many part of your
answer.
_----------------------------------------------------------_
Select DatabaseName, TableName ,columnName,
Case When IndexType='K' Then 'Primary Key'
When IndexType='S' Then 'Secondary Index'
When IndexType='P' Then 'Primary Index'
When IndexType='Q' Then 'PPIndex'
When IndexType='J' Then 'Join Index'
End as implimented_Index
From DBC.Indices
Where TableName in
( Select distinct TableName
From DBC.Tablesize
Where DatabaseName <>'DBC'
And
CurrentPerm>0
)
Order by 1,2,3
_
Innocent
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / yuvaevergreen
Adding to the above,DBC.Indexes can be used to find whether
the index is PPI or join or hash or primary key.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / prasanna
Hi Innocent,
Appreciate for your answer.
But one small correction is that tablename and database name columns are present in DBC.indices itself where as you had went for a join condition with dbc.tablesize.
so without join condition we can take both tablename and database from dbc.indices table.
Thanks
Prasanna.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the purpose of joins in teradata and what are the available join types?
What is bteq script in teradata?
What is Difference b/w PI & PPI?how to implement PPI?
What are the functions performed by bynet?
in teradata level primary in table level allows duplicates why?
How teradata makes sure that there are no duplicate rows being inserted when its a set table?
Explain the types of join supports by teradata?
How do you check the performance of Teradata Query and list down the basic Performance Tuning steps you use?
What is the difference between union and union all in teradata?
What are types of partition primary index (ppi) in teradata?
What are the main components of teradata system?
What are the various etl tools in the market?