Page 1 of 1

Many columns

Posted: Tue Feb 13, 2007 1:14 pm
by user___
Hi guys,
I am creating a table with around ten or eleven columns. I do know that it is absolutely wrong practise but I am not sure about this in my case because I have seven columns whose values are integers and will not be more than a thousand and others are varchars(45) which is its maximum value. I wonder whether it is better to separate them or leave them in the way they are.

Posted: Tue Feb 13, 2007 1:31 pm
by Kieran Huggins
There's nothing wrong with having eleven columns - you should have as many as your data warrants.

Posted: Tue Feb 13, 2007 1:41 pm
by feyd
Kieran Huggins wrote:There's nothing wrong with having eleven columns - you should have as many as your data warrants.
However, knowing when to normalize (and when not to) is something to be aware of.

For example, if several columns are basically repeated such as user1, pass1; user2, pass2; etc, then it may be better to have a separate table for them. .. But it does depend on circumstance and usage some too.

Reply

Posted: Tue Feb 13, 2007 2:13 pm
by user___
I did some benchmarking and I got better results when my tables are separted.
feyd: I do not have cols like user1, pass1, user2, pass2, etc. They are not similar but despite this as I have already said I get better results with different ones.
Thank you guys.