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

perf: add KV read-modify-write primitive #29431

Closed
petermattis opened this issue Aug 31, 2018 · 1 comment
Closed

perf: add KV read-modify-write primitive #29431

petermattis opened this issue Aug 31, 2018 · 1 comment
Labels
A-kv-client Relating to the KV client and the KV interface. A-sql-mutations Mutation statements: UPDATE/INSERT/UPSERT/DELETE. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) X-stale

Comments

@petermattis
Copy link
Collaborator

Forked from #18657 (comment). For operations such as INSERT INTO .... VALUES(...) ON CONFLICT DO UPDATE SET n = n+1 it would be useful to have a KV primitive that encapsulated the n = n + 1 operation into a single round trip.

Yes, it's possible to push the read-modify-write steps down into the KV layer so it can all be done in one round trip. We have a KV Increment command that serves as a proof of concept for this, although it's not hooked up for use from SQL. This would be the ideal solution for your ON CONFLICT DO UPDATE SET x=x+1 (as opposed to UPSERT which just does a blind write of specified values).

@nvanbenschoten
Copy link
Member

For more context, see the discussion in #22778.

@knz knz added A-sql-mutations Mutation statements: UPDATE/INSERT/UPSERT/DELETE. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) labels Sep 21, 2018
@petermattis petermattis removed this from the Later milestone Oct 5, 2018
@nvanbenschoten nvanbenschoten added A-kv-client Relating to the KV client and the KV interface. and removed A-coreperf labels Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-kv-client Relating to the KV client and the KV interface. A-sql-mutations Mutation statements: UPDATE/INSERT/UPSERT/DELETE. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) X-stale
Projects
None yet
Development

No branches or pull requests

4 participants