DDC-2835: No Lock Hint on Joins #3541

Open
opened 2026-01-22 14:21:52 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Dec 3, 2013).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user manseuk:

There seems to be no lock hits added to the joins on a query. For example, take the following query :

SELECT w0*.name AS name0, w1_.name AS name1, c2_.name AS name2, count(w3_.id) AS sclr3 FROM workflow_request w3_ WITH (NOLOCK) INNER JOIN workflow_request_status w1_ ON w3_.status_id = w1_.id INNER JOIN workflow_action w0_ ON w3_.action_id = w0_.id LEFT JOIN workflow_transition w4_ ON w3_.transition_id = w4_.id INNER JOIN core_mno_account c5_ ON w4_.mno_account_id = c5_.id INNER JOIN core_mno c2_ ON c5_.mno_id = c2_.id LEFT JOIN workflow_state w6_ ON w3_.current_state_id = w6_.id WHERE w1_.ident IN (?) GROUP BY w0_.name, w1_.name, c2_.name ORDER BY w0_.name ASC, w1_.name ASC, c2*.name ASC [["waiting"]]

the with(nolock) is only added to the FROM clause .... it should be added after each join too

Originally created by @doctrinebot on GitHub (Dec 3, 2013). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user manseuk: There seems to be no lock hits added to the joins on a query. For example, take the following query : ``` SELECT w0*.name AS name0, w1_.name AS name1, c2_.name AS name2, count(w3_.id) AS sclr3 FROM workflow_request w3_ WITH (NOLOCK) INNER JOIN workflow_request_status w1_ ON w3_.status_id = w1_.id INNER JOIN workflow_action w0_ ON w3_.action_id = w0_.id LEFT JOIN workflow_transition w4_ ON w3_.transition_id = w4_.id INNER JOIN core_mno_account c5_ ON w4_.mno_account_id = c5_.id INNER JOIN core_mno c2_ ON c5_.mno_id = c2_.id LEFT JOIN workflow_state w6_ ON w3_.current_state_id = w6_.id WHERE w1_.ident IN (?) GROUP BY w0_.name, w1_.name, c2_.name ORDER BY w0_.name ASC, w1_.name ASC, c2*.name ASC [["waiting"]] ``` the `with(nolock)` is only added to the `FROM` clause .... it should be added after each join too
admin added the Improvement label 2026-01-22 14:21:52 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3541