Ask HN: How many columns do you have on your Users column in your db?

2 points by pzaich ↗ HN
We've currently got 26 columns on our users tables. I'm curious how that compares on average.

2 comments

[ 0.26 ms ] story [ 13.5 ms ] thread
As it stands in a classifieds application app I have 9 columns:

ID, username, password, email, last_login, role_id, status, auth_code, remember_me

Just out of curiosity why do you have 26 columns? I presume you're also storing data like first_name, last_name, address, country, etc? I am too, but I cleverly have a user_meta table that allows dynamic user meta values. Your approach is probably faster because you're not joining any other tables.

Your cleverness means it's slow in some instances... Getting a list if users with a diverse criteria set is a gnarly query...