Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Altering the size of autopk sequence by 3X default size

SKomal76
Level 1
Level 1

Hello,

 

I want to know how can we alter the size of the dafault autopk, there is something with custom autopk/pksequence, but I am unable to find How to make the autopk size - 3X of its default one?'

 

Thanks.

Komal

1 Accepted Solution
Jonathon_wodnicki
Correct answer by
Community Advisor
Community Advisor

Hi,

 

Autopk sequence goes by rdbms' capability and can be altered as needed, e.g. alter sequence ... maxvalue 99999.

Be mindful of the key's size, default autopk is 32 bit signed integer = ~2B max value.

Changing the field size by adding this attribute could work but sounds like something that would break warranty:

  • <attribute name="id" type="int64"/>

 

Thanks,

-Jon

View solution in original post

0 Replies
Jonathon_wodnicki
Correct answer by
Community Advisor
Community Advisor

Hi,

 

Autopk sequence goes by rdbms' capability and can be altered as needed, e.g. alter sequence ... maxvalue 99999.

Be mindful of the key's size, default autopk is 32 bit signed integer = ~2B max value.

Changing the field size by adding this attribute could work but sounds like something that would break warranty:

  • <attribute name="id" type="int64"/>

 

Thanks,

-Jon

View solution in original post

SKomal76
Level 1
Level 1

Hi Jon,

 

After gathering a lot of information, I think we can use pksequence to alter the default size of autopk which we mention in the main element of the schema body.

 

By default autopk takes 32 bit size and enrolled its pksequence under "XtkNewId" by default, yes, we don't mention this.

 

Now let's say I wanted to make its size of 64 bit, now I want to know under which schema(instead of XtkNewId) we can store this updated default size of autopk?

I referred: Database mapping | Adobe Campaign

 

A snippet from  Database mapping | Adobe Campaign

NOTE

A sequence referenced in an Adobe Campaign schema (NmsTrackingLogId for example) must be associated to a SQL function that returns the number of IDs in the parameters, separated by commas. This function must be called GetNewXXXIds, where XXX is the name of the sequence (GetNewNmsTrackingLogIds for example). View the postgres-nms.sqlmssql-nms.sql or oracle-nms.sql files provided with the appliation in the datakit/nms/eng/sql/ directory to recover the example of a ‘NmsTrackingLogId’ sequence creation for each database engine.

 

 

Also, as per my knowledge we can't exceed the size of 64 bit using pksequence for autopk, please reflect your knowledge on this point as well.

 

Thanks.

Komal

 

 

Jonathon_wodnicki
Community Advisor
Community Advisor
64 bits should be enough for anybody. To set the sequence name for autopk the attribute is pkSequence="...". If you're trying to overcome the broadlog limitation there's official guidance here: https://helpx.adobe.com/customer-care-office-hours/campaign/sequences-exhaustion-campaign-classic.ht...