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
-
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
/deleteRedemptionById
but 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
/deleteRedemption
might not be very meaningful right now.deleteRedemption
always returnstrue
– so why return something?deleteRedemptionById
will returnfalse
when it initially does not find the ID – but when you call it multiple times with the same$id
it will returntrue
every time. It should returntrue
only the first time.Beta Was this translation helpful? Give feedback.
All reactions