Michal Migurski wrote:
In my experience, it's usually a safe assumption that if you have a bunch
of tables all structured identically and used in similar ways, you should
probably merge them all into a single table with an extra column that
corresponds to whatever differentiating characteristic used to distinguish
your original tables.

I.e., go with John Holmes' suggestion before you're really up the creek.

Up what creek? You didn't really provide any technical justification for your suggestion.


In my experience, the best way to deliver a quality application is to start with a fully-normalized database schema, then de-normalize it slightly here and there if performance is really a problem. But I've rarely had to do that. In most cases, an upgrade to a faster server with more memory solves the problem more quickly and cheaply than an application re-write would.

On the other hand, I've been called in many times to deal with application problems that arise from using "mashed-together" schemas such as the one you propose.

John W. Holmes wrote:
> The first thing you need to do is reorganize your database schema and
> put all of this into one table. You can see what a pain it is having 24
> similar tables already and it's only going to get worse.

The "pain" only occurs when writing the SQL statements to join the tables. I don't think it's a good idea to optimize the database schema for the sake of the programmer, who only has to write the SQL one time. Later, when the customer wants to fix bugs, or add enhancements, the pain is far greater. That's usually when I get called in, long after the original programmer has flown the coop.

The only times I ever purposely deliver denormalized applications such as you suggest are when the customers are asking for quick-and-dirty stopgap solutions. Then it makes sense to optimize for the application writer. However, I have found that stopgap solutions have a way of becoming permanent. These days, I usually turn down such jobs.

cheers,

Travis

--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to