|
However many you need. Seriously.
A typical rule of thumb is there should be a maximum of 7 tables listed with join conditions in a data warehouse. If yours is for a site, it's probably transactional, so you'd want to access less tables at the same time. But that doesn't speak to how many you might have, dormant in a particular query.
If you have a gigantic, highly scalable database driving your site, you might take some of your core tables, and "partition" them out into a table per day. That could mean thousands of tables in a database. This is a very common scenario. I don't know how MySQL handles that (question for Tripy) but Oracle, SQL Server, and hopefully many others, will have no trouble whatsoever with this.
If you're reading a lot, you might want one giant table, so as to avoid joins and complex predicates. If you're writing a lot, you'll want as many "broken up" tables as possible, so that you can write a single logical operation and avoid as much as possible. For example, if you had people and addresses, you might want them in different tables so you can change somebody's last name, but not have to also rewrite (because of row splits) their address. But normally, normalizing is a good thing, for performance, and because other database people will understand it and better be able to help you.
|