Hi @kevinqu4,
If you’ve created a custom sequence key for your custom schema, it’s possible that the sequence has been fully exhausted. This can lead to database errors such as “duplicate key” violations during insert operations. Such issues can disrupt processes like workflow executions, data imports, or delivery logging essentially halting any operation that relies on unique IDs (e.g., broadlog or delivery tracking).
To address this issue:
Proactive Measures:
Reduce data retention periods for high-volume tables (for example, lowering broadlog retention from the default 180 days to better align with your send volumes).
This helps prevent rapid ID consumption and delays sequence exhaustion.
Immediate Resolution:
Best Practices:
Assign dedicated sequences to custom or high-volume tables using the pkSequence attribute in the schema.
This isolates ID consumption from shared sequences (e.g., xtkNewId).
Implement monitoring workflows to track remaining ID capacity versus expected volume.
Additional Tip – Sequence Key Gap Analysis:
In cases where records are frequently inserted and deleted, gaps in sequence keys can accumulate.
Performing a gap analysis can help identify large unused key ranges.
Once identified, you can reset the sequence to start from the beginning of that largest gap to reuse available IDs efficiently for a period of time.
Thanks,
Sushant Trimukhe