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

Support skip lock and no wait #234

Open
si3nloong opened this issue Feb 24, 2023 · 1 comment · May be fixed by #175
Open

Support skip lock and no wait #234

si3nloong opened this issue Feb 24, 2023 · 1 comment · May be fixed by #175
Assignees
Labels
enhancement New feature or request

Comments

@si3nloong
Copy link
Owner

https://dev.mysql.com/blog-archive/mysql-8-0-1-using-skip-locked-and-nowait-to-handle-hot-rows/

@si3nloong si3nloong self-assigned this Feb 24, 2023
@si3nloong si3nloong added the enhancement New feature or request label Feb 24, 2023
@si3nloong si3nloong added this to the Version 2 milestone Feb 24, 2023
@si3nloong si3nloong linked a pull request Feb 24, 2023 that will close this issue
17 tasks
@si3nloong
Copy link
Owner Author

si3nloong commented Feb 27, 2023

Example of Queries:

SELECT seat_no, row_no, cost
FROM seats s JOIN seat_rows sr USING ( row_no )
WHERE seat_no IN ( 3,4 ) AND sr.row_no IN ( 5,6 )
AND booked = 'NO'
FOR UPDATE OF s SKIP LOCKED;
SELECT seat_no
FROM seats JOIN seat_rows USING ( row_no )
WHERE seat_no IN (3,4) AND seat_rows.row_no IN (12)
AND booked = 'NO'
FOR UPDATE OF seats SKIP LOCKED
FOR SHARE OF seat_rows;

Proposed API designs:

  1. Using chain function
options.LockForUpdate().NoWait()
options.LockForUpdate().SkipLocked()
  1. Separate with different expr
options.LockForUpdate()
options.LockForUpdate("columnA")
options.LockForUpdate(expr.Pair("db", "columnB"))

options.LockForUpdate(expr.NoWait())
options.LockForUpdate(expr.NoWait("columnC"))
options.LockForUpdate(expr.NoWait(expr.Pair("db", "columnB")))

@si3nloong si3nloong removed this from the Version 2 milestone Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant