Separate SEQUENCE objects for distributed table shards
Open
enhancement
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
Having one auto-incremental ID for records belonging to different tenants (located on different shards) is a potential bottleneck for INSERT. A possible solution is to use a UUID or shorter alternative, which is still longer than a 4 or 8-byte integer.
Is there any drawback in having _separate_ SEQUENCE objects (all starting with 1) for different shards of a distributed table?
E.g.,
| table_name | column_name | column_default |
|-|:-:|-|
| obj_102284 | id | nextval('obj_id_seq_102284') |
| obj_102285 | id | nextval('obj_id_seq_102285') |
| ... |
Is it possible with Citus? I assume that all queries use a composite key (tenant_id, object_id).
Contributor guide
Assessment
This issue has not been assessed yet.