Closed strager closed 1 year ago
Redemption table:
"CREATE TABLE IF NOT EXISTS "
"redemptions("
"broadcaster_id, "
"reward_id UNIQUE, "
"user_id, "
"redeemed_at, "
"level"
")"
Done in commit 0925835. Some notes:
SUM
call in sqlite, will that query be too slow when we have a big db? if so, how can we make it faster?@strager thoughts?
Will this scale up? I'm adding all the points using the
SUM
call in sqlite, will that query be too slow when we have a big db? if so, how can we make it faster?
It won't scale to a billion rows, but it should be fine with a million rows. 1 million redemptions / 3 redemptions per stream per day / 1 year = 913 streams
We could also have a method returning a list of tuples containing the sum of points per streamer for a given user.
I think this is a good idea, but not for MVP.
Redemption table:
Methods: