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

50.000 limit on update query with join #470

Closed
chironh opened this issue May 13, 2024 · 2 comments · Fixed by #483
Closed

50.000 limit on update query with join #470

chironh opened this issue May 13, 2024 · 2 comments · Fixed by #483

Comments

@chironh
Copy link

chironh commented May 13, 2024

I'm experiencing a very strange behaviour. Maybe it's related to one of the latest updates (I'm using version 9.0.1) because I haven't noticed this before (and I've worked with big datasets in the past).

This query limits to 50.000 records (which is a pretty specific number/cap if you ask me):

update account
set account.accountnumber = msdyn_customerasset.msdyn_name
from account
inner join msdyn_customerasset ON account.accountid = msdyn_customerasset.msdyn_account

whereas the following query has no limit:

update account
set account.accountnumber = null
from account
inner join msdyn_customerasset ON account.accountid = msdyn_customerasset.msdyn_account

To be clear, the dataset should update 57xxx records, which is the result of this query:

select account.accountnumber, msdyn_customerasset.msdyn_name
from account
inner join msdyn_customerasset ON account.accountid = msdyn_customerasset.msdyn_account
@chironh
Copy link
Author

chironh commented May 13, 2024

FYI: there are no safety limits in place.

edit: I haven't checked the actual number of records updated. I'm basing my comments on the information provided here:

image

@MarkMpn
Copy link
Owner

MarkMpn commented May 13, 2024

Thanks for the information!

The first query triggers legacy paging which limits the results to 50k. I'll look at improving this in the next update, but in the meantime you can work around it by forcing a calculation in the SET clause, e.g.

update account
set account.accountnumber = msdyn_customerasset.msdyn_name + ''
from account
inner join msdyn_customerasset ON account.accountid = msdyn_customerasset.msdyn_account

@MarkMpn MarkMpn mentioned this issue Jun 5, 2024
@MarkMpn MarkMpn linked a pull request Jun 5, 2024 that will close this issue
@MarkMpn MarkMpn closed this as completed in fa7b693 Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants