I just wanted to check if there is some reason why it wouldn't be a good idea to index the 'username' field in the user table?
I realise that we can't simply index every field, but it strikes me that this particular field is a good candidate for being indexed.
For example, one of the sites I've worked with ran the auth_ldap_sync_users.php on a regular basis against their userbase of approx 30,000 users - having an index on the username dropped the runtime for this script from approx 50 minutes to 30 minutes.
I suspect there are also other queries being carried out that would benefit from this index, but I have to ask if there is some reason this couldn't be added to the core install - does it impact somewhere else and cause other problems. Of course, there's nothing to stop me adding an index on our sites, but I was wondering if anyone else had come across this previously.
Only reason not to would be that your inserts are slower which means if you do a batch import of new users you might wait a while for it.