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

sql: cache sequence descriptors #28576

Merged
merged 1 commit into from
Aug 14, 2018
Merged

Conversation

knz
Copy link
Contributor

@knz knz commented Aug 14, 2018

Required for the tests in #28575.

nextval() was using uncached sequence descriptors.
There is no reason to do so anymore.

Release note (performance improvement): SQL sequences receive a slight
performance boost in the nextval() built-in function.

@knz knz requested review from a team August 14, 2018 13:20
@knz knz added this to Triage in (DEPRECATED) SQL Front-end, Lang & Semantics via automation Aug 14, 2018
@cockroach-teamcity
Copy link
Member

This change is Reviewable

`nextval()` was using uncached sequence descriptors.
There is no reason to do so anymore.

Release note (performance improvement): SQL sequences receive a slight
performance boost in the `nextval()` built-in function.
@BramGruneir
Copy link
Member

LGTM

@knz
Copy link
Contributor Author

knz commented Aug 14, 2018

thank you!

bors r+

craig bot pushed a commit that referenced this pull request Aug 14, 2018
28573: roachtest: fix queue failure message r=petermattis a=tschottdorf

It was using a global variable instead of the one it wanted.

Touches #28372.

Release note: None

28576: sql: cache sequence descriptors r=knz a=knz

Required for the tests in #28575.

`nextval()` was using uncached sequence descriptors.
There is no reason to do so anymore.

Release note (performance improvement): SQL sequences receive a slight
performance boost in the `nextval()` built-in function.

Co-authored-by: Tobias Schottdorf <tobias.schottdorf@gmail.com>
Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Aug 14, 2018

Build succeeded

@craig craig bot merged commit ab37973 into cockroachdb:master Aug 14, 2018
@knz knz deleted the 20180814-cache-seqdesc branch August 14, 2018 14:06
@knz knz moved this from Triage to Finished (milestone 0731) in (DEPRECATED) SQL Front-end, Lang & Semantics Aug 14, 2018
@vilterp
Copy link
Contributor

vilterp commented Aug 15, 2018

Nice! Out of curiosity, what changed that allowed this? I remember being confused about which function to use to get the table descriptor (cached, not cached, etc) when I first wrote this.

@knz
Copy link
Contributor Author

knz commented Aug 15, 2018

When you first wrote this we had bugs in the lookup of descriptors that were created in the same txn so a call to nextval would hang. Vivek fixed this over the course of the past few months so now it's safe.

@vilterp
Copy link
Contributor

vilterp commented Aug 16, 2018

Excellent; thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants