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

batch enumerator optimization #1711

Merged
merged 3 commits into from
Dec 7, 2023
Merged

batch enumerator optimization #1711

merged 3 commits into from
Dec 7, 2023

Conversation

pjurewicz
Copy link
Contributor

no need to fetch next batch if the previous one is smaller than specified batch size
(related to #1708)

@@ -239,7 +238,7 @@ module ActiveRecord
)

expect {
repository.read(specification.in_batches.result).to_a
repository.read(specification.in_batches(3).result).to_a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you wanted an additional test with non-default batch size

no need to fetch next batch if the previous one is smaller than
specified batch size
@pjurewicz pjurewicz force-pushed the batch_reading_optimization branch from 03ecd61 to 6cfa14f Compare December 7, 2023 10:03
WHERE clause is present in the 2nd query
the first query do not need any condition
@pjurewicz pjurewicz force-pushed the batch_reading_optimization branch from a72a3f6 to a9fad6a Compare December 7, 2023 11:03
@pjurewicz pjurewicz merged commit 59e873d into master Dec 7, 2023
45 checks passed
@pjurewicz pjurewicz deleted the batch_reading_optimization branch December 7, 2023 11:08
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 this pull request may close these issues.

2 participants