Comment by w23j
1 day ago
I mean the inner select uses "limit 1", right? So it will usually (but not always as I said in another comment) only delete and return a single task.
1 day ago
I mean the inner select uses "limit 1", right? So it will usually (but not always as I said in another comment) only delete and return a single task.
Hmm, yep I didn't see that, thanks!
It's a confusing way to do do things to me, like, why not select ordered by task date limit 1? Still using for update and skip locked etc... hold the transaction, and update to 'complete' or delete/move the row when done? What's the advantage of the inner select like that?
And I'm still totally confused by:
This looks to me like usr_id would always be null?
I think the idea is great, I think I'm just struggling a bit with the code style, it seems to be "clever" in a way that increases cognitive load without a real benefit that I can see, but I suppose that's pretty subjective.