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/opt: add implicit SELECT FOR UPDATE support for DELETE statements #50181

Closed
nvanbenschoten opened this issue Jun 13, 2020 · 3 comments · Fixed by #137069
Closed

sql/opt: add implicit SELECT FOR UPDATE support for DELETE statements #50181

nvanbenschoten opened this issue Jun 13, 2020 · 3 comments · Fixed by #137069
Assignees
Labels
A-sql-optimizer SQL logical planning and optimizations. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) E-quick-win Likely to be a quick win for someone experienced. T-sql-queries SQL Queries Team

Comments

@nvanbenschoten
Copy link
Member

nvanbenschoten commented Jun 13, 2020

Address this TODO:

// tryApplyImplicitLockingToDeleteInput determines whether or not the builder
// should apply a FOR UPDATE row-level locking mode to the initial row scan of
// an DELETE statement.
//
// TODO(nvanbenschoten): implement this method to match on appropriate Delete
// expression trees and apply a row-level locking mode.
func (b *Builder) shouldApplyImplicitLockingToDeleteInput(del *memo.DeleteExpr) bool {
return false
}

Similar to #50180, but likely lower priority because sustained contending DELETEs don't seem to be as common, probably because once a row is deleted, it stays deleted and can't be deleted again.

Jira issue: CRDB-4147

@nvanbenschoten nvanbenschoten added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-optimizer SQL logical planning and optimizations. labels Jun 13, 2020
@nvanbenschoten nvanbenschoten self-assigned this Jun 13, 2020
@michae2 michae2 added T-sql-queries SQL Queries Team E-quick-win Likely to be a quick win for someone experienced. labels Apr 28, 2022
@blathers-crl blathers-crl bot added the T-kv KV Team label May 3, 2022
@mwang1026 mwang1026 removed the T-kv KV Team label May 17, 2022
@rytaft
Copy link
Collaborator

rytaft commented Jul 21, 2022

Is this a priority for 22.2?

@michae2
Copy link
Collaborator

michae2 commented Jul 26, 2022

This might be a good one for @wenyihu6 if interested.

@mgartner mgartner moved this to Backlog (DO NOT ADD NEW ISSUES) in SQL Queries Jul 24, 2023
Copy link

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

@rytaft rytaft moved this from Backlog (DO NOT ADD NEW ISSUES) to New Backlog in SQL Queries Jan 18, 2024
@yuzefovich yuzefovich self-assigned this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-optimizer SQL logical planning and optimizations. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) E-quick-win Likely to be a quick win for someone experienced. T-sql-queries SQL Queries Team
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants