Rabbit-Company / Passky-Server

Server for Passky (password manager)
https://passky.org
GNU General Public License v3.0
177 stars 22 forks source link

optimized queries that relevently hit more #5

Closed anasnaeem077 closed 2 years ago

anasnaeem077 commented 2 years ago

optimized queries that relevently hit more

zigazajc007 commented 2 years ago

Hello,

Thanks for helping, but COUNT(*) is exactly the same as COUNT(1). It has been tested many times and does not make any difference (https://learnsql.com/blog/difference-between-count-distinct/).

For isUsernameTaken function, SELECT vs SELECT user_id won't increase any performance, but it's a waste of bandwidth as SELECT would need to send more data thru the network (Which isn't the case with docker containers as both API and database are on the same machine).