Collect Statistics

Database
Enthusiast

Collect Statistics

Database Version: Teradata 13.10.0609  13.10.06.09A

Provider Version: ODBC 14.00.00.04

CREATE TABLE MY_TABLE AS (

SELECT COL1

 , COL2

 , COL3

FROM DB_TABLE

)WITH DATA

PRIMARY INDEX (COL1);

COLLECT STATISTICS MY_TABLE INDEX(COL1);

The table gets created, but collect statistics fails.

I have run the same process for months, but now I cannot collect statistics

5 REPLIES
Senior Apprentice

Re: Collect Statistics

Could you show the output (preferably BTEQ) including the actual error message?

This should run.

Dieter

Enthusiast

Re: Collect Statistics

No error message is generated.

After lots of trial and error, the solution was to uninstall and reinstall

Teradata SQL assistant. Do not know what went wrong, but everything

is back to normal, for now.

Thanks

Teradata Employee

Re: Collect Statistics

You can use DBQL to locate the error code and message (if the client was able to submit the SQL statement to the Teradata, which is hopefully true). 

Teradata Employee

Re: Collect Statistics

I am taking a join on a index column & its taking time to execute the following query 

SELECT

A.ACCOUNT_NUM AS ACCOUNT_ID,

A.Limit_Type_Cd,

A.Acct_Limit_Amt,

A.Acct_Limit_Expiry_Dt,

A.Acct_Limit_Ref_Id,

B.Limit_Ref_ID,

C.Collateral_Item_Id,

C.Collateral_Item_Type_Cd,

C.Collateral_Item_Status_Cd,

C.Collateral_Value_Amt,

C.Collateral_Nominal_Value_Amt,

C.Collateral_Max_Value_Amt,

C.Collateral_Item_Expiry_Dt

FROM UT_TAB.ACCOUNT_CREDIT_LIMIT AS A

INNER JOIN UT_TAB.LIMIT_DETAILS AS B

ON

A.ACCT_LIMIT_REF_ID = B.LIMIT_REF_ID

INNER JOIN UT_TAB.COLLATERAL_ITEM AS C

ON

B.Limit_Linked_CollateraL = C.Collateral_Item_Categ_Cd

C.Collateral_Item_Categ_Cd is the Secondary index column is there any solution to get the result faster

Enthusiast

Re: Collect Statistics

You need to show the ddl of the tables, the stats that are collected and the explain from the query to help determine why it is performing slowly.

--Shelley--