MySQL Forums
Forum List  »  Performance

Re: Question about the Query Cache and server settings
Posted by: Jay Pipes
Date: July 30, 2005 12:07PM

This is far and away one of the most awful table schemas I have ever seen. If this is how this company implemented the main user table schema, I am actually surprised that your forum is even up and running!

Some (funny) observations:

1) I am unsure whether the creators ever read a single page about normalization. I just love seeing fields like this:

`U_Extra1` varchar(200) default NULL,
`U_Extra2` varchar(200) default NULL,
`U_Extra3` varchar(200) default NULL,
`U_Extra4` varchar(200) default NULL,
`U_Extra5` varchar(200) default NULL,

2) Of all the things to "save space" on why would anyone bother to abbreviate index1 as indx1? Ooooh. I saved a single space for the letter "e"! Wow!

3) Out of 131 fields in this table, 34 are NULLable. For crying out loud, separate off rarely used or rarely queried fields into a separate table. Focus the efforts on keeping main and highly queried tables as narrow as possible. Criminy.

4) I challenge anyone out there to find me a single person that has:

a) a first name of 100 characters long.
b) a last name of 100 characters long.
c) a password of 150 characters long (could you imagine?)
d) a 25 character postal code
e) a 75 character country
f) a 50 digit mobile number (again, could you imagine that?)

5) Is it absolutely necessary to have all of the following as identifiers for the person?

a) Login Name (64 characters...!)
b) User Name (32 characters...!)
c) Email
d) Fake Email
e) Display Name
f) Name

Ughh, I feel for you Erin. This is awful. major work should be done to this. But, as with all business decisions, there are costs and benefits associated with tinkering with an existing application versus buying something better and migrating...

As for your comment about the indx1 index being redundant, that's actually not the case. The U_Username index is actually the one that is redundant, as it is entirely covered by the left prefix field of indx1. Here's another question for you: if U_Username is a UNIQUE KEY, and indx1 contains it entirely in it's left-most field, then wouldn't indx1 also be UNIQUE? Uh, yeah, it would. :)

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Question about the Query Cache and server settings
1701
July 30, 2005 12:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.