The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Indexing, keys, etc...

Does anyone have a link or personal explaination of some of the key topics to database design? I've made a few databases myself. All of which have been pretty simple in design. I've used the linking (I think it would be called primary keys too) idea by linking two tables by a column. That's about it though. Am I missing something that could make my databases faster, better designed, or something? Thanks in advance.

Does anyone have a link or personal explaination of some of the key topics to database design? I've made a few databases myself. All of which have been pretty simple in design. I've used the linking (I think it would be called primary keys too) idea by linking two tables by a column. That's about it though. Am I missing something that could make my databases faster, better designed, or something? Thanks in advance.

If you're using the InnoDB table type, you can help preserve referential integrity by using Foreign Keys. Unfortunately, the other table types in MySQL don't support this.

You should create an index on any column that you're going to be searching a lot using where clauses.

Hrm... I'm sure there are more tips to offer than this, though.

Oh yes, something I just thought of:

If the column you're using in the join has the same name in both tables, you should try changing your syntax from this: