问题
I got this Teradata failure 7545 Identity Column is over its limit, but I am only insert a few hundreds records and i have already change data type from INT to BIGINT.
Here is my create table syntax, I am really puzzled why Teradata was not happy?
CREATE TABLE LOCATION
( LOCATION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1 MAXVALUE 1000000) ,
....
Any insight would be greatly appreciated
回答1:
Your definition defaults to NO CYCLE
and MAXVALUE
is set to 1000000
, so it doesn't matter if you use an INT
or BIGINT
, the maximum number is 1,000,000.
Teradata assigns an IDENTITY in parallel, i.e. it's each AMP/PE requests a range of numbers based on the dbscontrol
parameter IdCol Batch Size
, so 1,000,000 will be reached way before you actually insert a million rows.
Remove the MAXVALUE
, but keep the BIGINT, use INT only if need to store up to a few million rows...
回答2:
Try with ALWAYS and NO CYCLE instead of generate by default... Also check for the IdCol Batch Size in your DBSCONTROL parameter 27. Like in my case it was 10k so , try to increase it and then try.
- IdCol Batch Size = 10000
回答3:
Here is a solution that worked:
I increased the max value to 100 million.
The reason is that each AMP gets a 100,000 range of numbers. I have 72 AMPs in my 2750 appliance, so a minimum max value is 7.2 million. When my definition of the max identity column value exceeds 7.2 million, it worked.
来源:https://stackoverflow.com/questions/33312682/teradata-15-failure-7545-identity-column-is-over-its-limit