Learn-Build-Teach / learn-build-teach-discord-bot

53 stars 17 forks source link

Get username from db again. #55

Closed mhuggins7278 closed 2 years ago

mhuggins7278 commented 2 years ago

Getting all the kudos along with the username in one query then building up the leaderboard object on the server in JS.

also added kudos by type with the appropriate emoji's

image

@jamesqquick

jamesqquick commented 2 years ago

Any thoughts on which solution is more performance. With the one you added, we'll have to query every kudo record which I'm a bit worried about as the table starts to build up. I guess mine does a full table scan as well even though it only takes 10 records. It has to search them all first before it can sort and take 10.

mhuggins7278 commented 2 years ago

Yeah I still want to seed a bunch of fake records and test the diff. In general I've always found it more perfomant to filter and stuff in app vs in the db

On Sun, Mar 27, 2022, 5:04 PM James Q Quick @.***> wrote:

Any thoughts on which solution is more performance. With the one you added, we'll have to query every kudo record which I'm a bit worried about as the table starts to build up. I guess mine does a full table scan as well even though it only takes 10 records. It has to search them all first before it can sort and take 10.

— Reply to this email directly, view it on GitHub https://github.com/Learn-Build-Teach/learn-build-teach-discord-bot/pull/55#issuecomment-1080018794, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJGMECKFJQR4JABQNOKW7TVCDEOPANCNFSM5RWBN57A . You are receiving this because you authored the thread.Message ID: <Learn-Build-Teach/learn-build-teach-discord-bot/pull/55/c1080018794@ github.com>