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

Improve "unfulfilled" scope by adding subquery #191

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

AlessioRocco
Copy link
Contributor

@AlessioRocco AlessioRocco commented Jan 29, 2021

SolidusSubscriptions::Installment#unfulfilled gets the list of fulfilled installments, loads them ALL into memory, and then performs a WHERE id NOT IN (...) to get the installments that were not fulfilled, this PR simplify the scope using a WHERE clause with a subquery.

This fixes #171.

"SolidusSubscriptions::Installment#unfulfilled" gets the list of
fulfilled installments, loads them ALL into memory, and then performs
a WHERE id NOT IN (...) to get the installments that were not fulfilled,
this commit simplify the scope using a WHERE clause with a subquery.
@AlessioRocco AlessioRocco force-pushed the improve-unfulfilled-scope-query branch from a57e691 to 90ea23c Compare January 29, 2021 10:53
@AlessioRocco AlessioRocco self-assigned this Jan 29, 2021
@AlessioRocco AlessioRocco marked this pull request as ready for review January 29, 2021 10:54
Copy link
Contributor

@ChristianRimondi ChristianRimondi left a comment

Choose a reason for hiding this comment

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

👍

@aldesantis aldesantis merged commit 4bd54e6 into master Feb 5, 2021
@aldesantis aldesantis deleted the improve-unfulfilled-scope-query branch February 5, 2021 13:39
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.

Installment.unfulfilled is a drag on performance
3 participants