Database for efficient retrieval of data from large data set
All you need here is to make the username a unique index and MySQL will (generally) handle this very well. 

Unfortunately, I had to write 'generally' because there can be many many other factors on your system that could slow this down. I recommend having MySQL 5.5 and the table be InnoDB. Proper indexing and configuration will go a long way in helping you.

The short of it is, MySQL/InnoDB is easily able to handle 10 million rows.