Re: FW: [PHP-DB] Solved!--But Query Optimization for many-to-many tab les (fwd)
| From: | Doug Semig | Date: | Wed, 26 Jul 2000 18:11:38 +0000 |
| Subject: | Re: FW: [PHP-DB] Solved!--But Query Optimization for many-to-many tab les (fwd) | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1534@lists.php.net to get a copy of this message | ||
I myself, of course, would never use an SQL reserved word for a table name.
As a matter of fact, I believe if you look through the archives of the
PHP-DB list (which is where I post), you'll find that I suggested
"product", "type", and "product_type" as the names for the tables.
When the original poster came back with the proper solution and asking
about optimization, I:
1. was overjoyed that he actually listened to someone and learned something
2. wanted to say that RDBMSs typically already do query optimization
3. wanted to convey the importance of secondary indexes
So I completely overlooked the unfortunate table name. While on the topic,
I've been quite dismayed lately about how folks name their tables. For
example, I've seen databases filled with tables that are named things like
"tblCustomer," "tblOrder," and "tblInvoice." This just drives me up a
wall. In modern RDBMSs, there's no need to prefix the table name with
"tbl" because you can simply run a stored procedure or some other built-in
kind of query to show you a list of only tables. (DISCLAIMER: I do prefix
my indexes, though, with "ix_", but the reason is because of namespace
issues...not to readily identify the construct as an index.) The table
name prefixing habit is equally as annoying to me as when folks use a
plural table name.
But I digress... Thanks to both of you for catching that...I should have
caught that in my reply to the poster.
Doug
Robert Hall was heard at 10:30 AM 7/26/00 -0400 to say:
>On Wed, 26 Jul 2000, Foley, John wrote:
>
>> Beware of table names (or column, ets) like 'Join' . . . it is an
>> SQL reserved word and may behave very differently in diferent RDBMS's
>
>John's right. I used 'Join' in my suggestion as a sort of generic name to
>indicate that it was a join table. In addition to the problem that John
>mentions, there's the problem that occurs when you have many tables, and
>you haven't looked at the tables in months, and now you have to do some
>maintanence. Which two tables does Join join? You won't have a clue.
>
>A better name would be something like products_to_types, or better,
>products_join_types, which has the advantage of saying that it is a join
>table.
>
>> The geographical center of Boston is in Roxbury. Due north of
>> the center we find the South End. This is not to be confused with South
>> Boston which lies directly east from the South End. North of the South
>> End is East Boston and southwest of East Boston is the North End.
>
>If you understand that, you're overqualified for this mail list.
>
>Bob Hall