Reduce the amount of queries performed when updating plan (#31268)

Release Notes:

- N/A
e88cad29e5Antonio Scandurra committed on 5/23/2025, 12:03:50 PM· committed by GitHubparent9b7d849
2 files changedLine totals unavailable