citusdata / citusdata/citus

Separate SEQUENCE objects for distributed table shards

Open
#6,168 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.