I'm trying to join two tables for


project 2 (users, history), but i
read that JOIN isn't a good practice and will eventually be bad if
your tables get larger.
so i created new tables as the following:
used a foreign key.
the question now am i on the right track?
is JOIN real problematic with larger tables?
is FK any better than JOIN?

another method my friend pointed me to but its also condusing:

he doesn't join or use a FK but he told me to use php to fill everything because table relations are slow...

I am really confused about MySQL i don't know how to design my tables. is there any reliable book or source to learn from other than the MySQL manual cause i am a beginner and the manual isn't friendly...

Thanks in advance.

6 Years
Discussion Span
Last Post by smantscheff

JOIN is a part of a clause for querying related tables, not for design.
You are on the right track. Use foreign keys wherever possible to enhance database integrity. No, they don't harm the performance except with large insert or update operations. But unless you have millions of users you won't notice any difference.
When learning mysql make use of the command line mysql client rather than using phpmyadmin or other higher level interfaces. They do a good job but you don't know what your are doing in terms of data definition and manipulation langugage.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.