Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Add a tserver flag to allow limiting the minimum value for sequence CACHE #6041

Closed
m-iancu opened this issue Oct 14, 2020 · 1 comment
Assignees
Labels
area/ysql Yugabyte SQL (YSQL)
Milestone

Comments

@m-iancu
Copy link
Contributor

m-iancu commented Oct 14, 2020

In a distributed context sequences add more relative overhead as getting one (or more) new value(s) requires global locking.
Therefore, for practical performance we recommend using a higher CACHE value (or a type with a unique value generator like UUID, instead).

However, in some cases, large schemas are exported from other systems (e.g. vanilla Postgres) many sequences with CACHE explicitly set to low values (e.g. 1). This is because, even when the cache option was not specified on sequence creation, its value (the vanilla Postgres default 1) will be made explicit when exporting it (therefore being specified in the SQL dump file for each sequence).

To improve usability for such migration use-cases, we should add a tserver flag ysql_sequence_cache_minval (default 100) that will override the chosen cache value for a sequence (and log a message to the user), if it is lower than the set flag.

@m-iancu m-iancu added the area/ysql Yugabyte SQL (YSQL) label Oct 14, 2020
@m-iancu m-iancu added this to the v2.3 milestone Oct 14, 2020
@m-iancu
Copy link
Contributor Author

m-iancu commented Oct 14, 2020

Fixed by 6d29fc6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL)
Projects
None yet
Development

No branches or pull requests

2 participants