Feature/239 request sequence generators#244
Open
Uday-Polineni wants to merge 6 commits into
Open
Conversation
Uday-Polineni
force-pushed
the
feature/239-request-sequence-generators
branch
2 times, most recently
from
July 2, 2026 22:20
d1479c1 to
087851a
Compare
Uday-Polineni
force-pushed
the
feature/239-request-sequence-generators
branch
from
July 2, 2026 22:23
087851a to
d7f35ad
Compare
Uday-Polineni
force-pushed
the
feature/239-request-sequence-generators
branch
from
July 2, 2026 22:25
d7f35ad to
cc22c6e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements regional request ID sequence generators for Virginia and Ireland (#239). It introduces a band-from-sequence format
REQ-{band}-XXX-XXX-XXX-XXX, with each region assigned a non-overlapping sequence range so IDs stay globally unique.Problem
The existing
generate_request_id()function had the following issues:seq_id, limiting scale for Ireland’s trillion-scale rangeNO MINVALUE,NO MAXVALUE) — ranges were not partitioned per regionnextval('request_id_seq')instead of the schema-qualified sequence nameApproach
New ID format:
REQ-{band}-XXX-XXX-XXX-XXX(2-digit band + four 3-digit groups)Sequence range partitioning:
001→999,999,999,999REQ-00-000-000-000-001011,000,000,000,000→1,999,999,999,999REQ-01-000-000-000-000Band-from-sequence (same function in both regions):
FLOOR(seq_id / 1,000,000,000,000)seq_id = 1→ band00; Irelandseq_id = 1T→ band01Future-proofing (new regions / exhausted ranges):
NNmaps to sequence valuesNN × 1Tthrough(NN + 1) × 1T − 100(0→1T − 1); Ireland uses band01(1T→2T − 1)02with sequenceSTART 2,000,000,000,000,MAXVALUE 2,999,999,999,999→ IDs likeREQ-02-...03→3Tto4T − 1, and so on)generate_request_id()logic applies everywhere — band is always derived fromFLOOR(seq_id / 1T); only the sequenceSTART/MINVALUE/MAXVALUEchanges per regionFiles changed
ddl/Tables/ddl_request.sqlgenerate_request_id()ddl/Tables/Scripts/ireland_dev_saayam_rdbms.sqlgenerate_request_id()ddl/ddl_changes/ddl_alter_virginia_sequence_generator.sqlCREATE OR REPLACE FUNCTIONddl/ddl_changes/ddl_alter_ireland_sequence_generator.sqlCREATE OR REPLACE FUNCTIONscript-library/tests/test_virginia_generate_request_id.sqlREQ-00-...)script-library/tests/test_ireland_generate_request_id.sqlREQ-01-...)Test plan
test_virginia_generate_request_id.sql— all checks returnOK:test_ireland_generate_request_id.sql— all checks returnOK:BEGIN/ROLLBACKCloses #239