MySQL question - perhaps interesting?

Ilya Palagin tux-4CS0UopE6WdBDgjK7y7TUQ at public.gmane.org
Sun Mar 13 06:04:54 UTC 2005


Zbigniew Koziol wrote:
...
> My question is in which order should I populate MySQL database to get 
> the fastest search for words: starting from the most frequentely used 
> words or from least frequent words? This actually can be tested easiely 
> and I will report the result. But perhaps exists a different approach to 
> the problem?
You don't need any order, but don't forget about index.

> 
> Users of web page will enter some text into the form. Computer will 
> search for transcription of every word entered. The PHP program I am 
> using (translation by me from Visual Basic) is good for small number of 
> words but at large amounts of text web server times out. So instead of 
> calculating transcription every time, for every word, I wanted rather to 
> create a database of words and their transciptions.

Depending on amount of words and performance of your web server,
a different approach may be good for you.
Your data will be static - you'll prepare a list of words, users won't 
submit new
ones, right?.  In this case, there is just no need in a Database Management
System which MySQL is.  Instead, generate a hash (key - the word, value 
- its
transcription), dump it into a binary db file,  and use it as a hash 
object in your
script.  It's easy in perl, should be possible in PHP too.
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list