MySQL Forums
Forum List  »  Performance

Basic conception for database
Posted by: Rafal Drezek
Date: May 15, 2009 03:18AM

Hello,

I have academic question regarding DB performance. I am not DB expert but have some basic understanding about DB's and how to build simple SQL queries.

I want to build online database (PHP + MYSQL) providing some translations. Here I expect high load.

The questions is what will be the best approach to organize a tables.
Lets take this example:
Table A contains words in one language (with unique ID field)
Table B contains words in another language (with unique ID field)
Table C contains matching (connects words from table A and B considering the fact that one word from A can have many matches from B and oposite way).

If somebody wants to search the DB I can do 3 statements:
(1) select all matching fields from A
(2) for or results from 1 go to tha matching table C and find what would be translation from B
(3) read translations from C

OK. I know its not good approach, becuase one join can solve it. Right?
Can anybody provide me a good example for JOIN for given case? (assuming that tables A and B contain ID + word, table C contains two fields: ID from A, ID from B)

Another possibility:
What if I create one table (D) with: ID , word in one language, word in second language.
Here is one problem: I will have several same entries in one field (one word can have several translations), but even if for the previous case I build join, shouldn't it be better (regarding performance).

My goal is to have best performance.

Thanks for any suggestions on that.

regards
R.

Options: ReplyQuote


Subject
Views
Written By
Posted
Basic conception for database
4331
May 15, 2009 03:18AM
2149
May 17, 2009 01:37PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.