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

Performance: validate_user_usage_limit() #8482

Closed
mikejolley opened this issue Jun 29, 2015 · 7 comments
Closed

Performance: validate_user_usage_limit() #8482

mikejolley opened this issue Jun 29, 2015 · 7 comments

Comments

@mikejolley
Copy link
Member

@mikejolley mikejolley commented Jun 29, 2015

This was bought up in conversation with @pmgarman.

Issue is every time a coupon is used, a meta value is stored in _used_by. Coupons used hundreds of thousands of times cause issue on load.

We should look into a better way of storing this data.

@pmgarman
Copy link
Contributor

@pmgarman pmgarman commented Jun 29, 2015

I posted in my dev blog a bit of background on how this can cripple a site in an edge case.

@memtoko
Copy link

@memtoko memtoko commented Jul 5, 2015

IMO use different table for that.

@pmgarman
Copy link
Contributor

@pmgarman pmgarman commented Jul 5, 2015

That's my opinion as well

@mikejolley mikejolley added this to the 2.5 (name undecided) milestone Jul 6, 2015
@mikejolley
Copy link
Member Author

@mikejolley mikejolley commented Aug 4, 2015

@georgestephanis georgestephanis self-assigned this Aug 4, 2015
@georgestephanis
Copy link

@georgestephanis georgestephanis commented Aug 4, 2015

Having this stored as meta on the coupon also makes it difficult to track down what coupons a given user has used. Let me look into the schema and see what I can come up with.

@georgestephanis
Copy link

@georgestephanis georgestephanis commented Aug 24, 2015

Okay, first swing at this completed:

When calling validate_user_usage_limit() -- we really don't need all the data for all usages, so I simplified the check in e6b7d5c

I also optimized some calls we're using in populate() with 6ef4cf0

Pull request generated as #8940

@mikejolley mikejolley removed this from the 2.5 (name undecided) milestone Sep 9, 2015
@mikejolley mikejolley added this to the Performance Audit milestone Sep 9, 2015
@mikejolley mikejolley added this to the Performance Audit milestone Sep 9, 2015
@mikejolley mikejolley removed this from the 2.5 (name undecided) milestone Sep 9, 2015
mikejolley referenced this issue Sep 15, 2015
Tidy up how we're dealing with coupon postmeta around `_used_by` which can get big.
@pmgarman
Copy link
Contributor

@pmgarman pmgarman commented Sep 15, 2015

🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants