I got a user table containing 15+ million records and while doing the registration function i wish to check whether the username already exist. I did indexing for username column and when i run the query "select count(uid) from users where username='webdev'"
,. hmmm, its keep on loading blank screen finally hanged up. I'm doing this in my localhost with php 5 & mysql 5. So suggest me some technique to handle this situation.
Is that mongodb is good alternative for handling this process in our local machine?
Thanks, Nithish.
If you just want to check that it exists or not, try not using the count
. Just a simple select username from users where username='webdev' LIMIT 1
may be faster.
ALSO, change the column type to varchar
, if it's not already so. Don't user text
type. It's much much slower.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With