Re: Ultra fast db access & searching?
- From: Bill Karwin <bill@xxxxxxxxxx>
- Date: Fri, 25 Nov 2005 10:58:38 -0800
Aerodyne wrote:
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.
I'd put an index on the username field and increase the size of the MySQL key cache. The key cache is a specific block of memory that is used to store indexes. If this is large enough, MySQL may be encouraged to store the entire index in memory, so it won't need to access the disk to use that index.
See also http://dev.mysql.com/doc/refman/5.0/en/myisam-key-cache.html, and especially about index cache preloading: http://dev.mysql.com/doc/refman/5.0/en/index-preloading.html
Anyway, that should put the index into system memory, and subsequent lookups (B-tree lookups on a data structure cached in memory) will be about as fast as you could hope for, given the technology choice.
I'm not sure if PostgreSQL has a similar tuning option. I'll leave that research to you. :)
Regards, Bill K. .
- References:
- Ultra fast db access & searching?
- From: Aerodyne
- Ultra fast db access & searching?
- Prev by Date: Re: Ultra fast db access & searching?
- Next by Date: Re: Needed: An Efficient, reliable and smart way to copy data from one DB to another
- Previous by thread: Re: Ultra fast db access & searching?
- Next by thread: DBModelled Storage in JAVA
- Index(es):
Relevant Pages
|
|