Replies: 1 comment
-
|
I'll agree that this probably isn't the right approach for this sort of data, but the goal was performance gains. But as you mention, that's going to do the opposite, if it isn't already for large installs. For the delete actions, calling As for why To get this early, run:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Do I understand
gift-voucher/src/services/Redemptions.php
Lines 38 to 46 in 3a20c0b
gift-voucher/src/services/Redemptions.php
Lines 125 to 153 in 3a20c0b
correctly in that you will load ALL redemptions when searching for a single redemption or a redemption for a specific code?
Why did you opt to memoize the database queries for redemptions? I have searched for usage of
getRedemptionById/getRedemptionsByCodeId/deleteRedemptionByIdbut did not find any that would warrant memoization in my opinion.Having someday hopefully millions of redemptions in the database, this looks strange to me.
Side note: the return value of
deleteRedemptionById/deleteRedemptionmight not be very meaningful right now.deleteRedemptionalways returnstrue– so why return something?deleteRedemptionByIdwill returnfalsewhen it initially does not find the ID – but when you call it multiple times with the same$idit will returntrueevery time. It should returntrueonly the first time.Beta Was this translation helpful? Give feedback.
All reactions