OpenConceptLab/ocl_issues#878 | Locale type standardization#15
Open
snyaggarwal wants to merge 3 commits intomasterfrom
Open
OpenConceptLab/ocl_issues#878 | Locale type standardization#15snyaggarwal wants to merge 3 commits intomasterfrom
snyaggarwal wants to merge 3 commits intomasterfrom
Conversation
| for start in range(0, total, batch_size): | ||
| end = min(start + batch_size, total) | ||
| locales = LocalizeText.objects.filter( | ||
| id__in=queryset.order_by('id')[start:end].only('id').values_list('id', flat=True)) |
Contributor
There was a problem hiding this comment.
I feel this will not perform well... start:end is a slow one for millions of records to update as it uses OFFSET. Also if you use 'values_list' you don't need 'only'. We should be able to change it to an update without a subquery like:
update localized_texts set type='FULLY_SPECIFIED' where type in ('Fullly Specified', 'Fully_Specified', ...)
Contributor
Author
There was a problem hiding this comment.
Ya, I can change that to run direct SQL:
update localized_texts set type='FULLY_SPECIFIED' where type in ('Fullly Specified', 'Fully_Specified', ...)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.