Ultra fast db access & searching?



Hi all,

Could some one help me out with this Q?

If I designed a db (MySQL or PostgreSQL) & it contained more than 5+
million users with all unique user names... how can I speed up db
access ...etc to search a new users name if it has already been taken?

All hints & tips welcome (plus good db books on this matter & some)...

The reason I ask is to know how sites like hotmail, gmail, ebay ...etc
all do it so quickly! But I'd prefer to use either MySQL or
PostgreSQL.


TIA

.