Mysql help

  • darkmonkey
  • Newbie
  • Newbie
  • darkmonkey
  • Posts: 14

Post 3+ Months Ago

I have a question on mysql,
is their a limit to the amount of fields a table can have?, and if not would alot of fields slow it down?

Im working on a mod for phpBB, and i need to add alot of fields for new info to the user details. i thought i had 2 options-

1. create a new table to hold the new fields
or
2. add all the fields onto the current user table

If you think i should use the first option, how should i go about linking this?

Thanks in advance,
darkmonkey
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

If there's a specific limit to the number of fields in a MySQL table I haven't come across it in the Manual so far, but I don't have enough experience with phpbb/mysql to recommend any course of action. Hopefully someone else can give you an idea of the best way to proceed.
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

If you want the fields to act seperate from the user's description, then it might work better to have it in a seperate table. However if you want to call fields from both the user's description and these new fields, keep it as one. There is no limit and it won't slow it down much if you use the right field types.
  • darkmonkey
  • Newbie
  • Newbie
  • darkmonkey
  • Posts: 14

Post 3+ Months Ago

right thanks, so about 80 or 90 fields would be ok?
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

I won't say yes and I can't say no.

You probably WILL experience some slow downs when you are querying that many fields no matter how you do it. Take at look at out statistics page, while that does lots of complicated math, it also has to do many queries, and therefor takes very long to load.

I would check this section from the mysql documentation out:
http://www.mysql.com/documentation/mysq ... #Data_size
  • darkmonkey
  • Newbie
  • Newbie
  • darkmonkey
  • Posts: 14

Post 3+ Months Ago

ok, thanks, ill check it out
  • Crimson_King
  • Newbie
  • Newbie
  • User avatar
  • Posts: 9

Post 3+ Months Ago

darkmonkey wrote:
right thanks, so about 80 or 90 fields would be ok?

i'd like to see your table and code structure, i don't beleive that the most efficient way of doing what you want to is with 80 or 90 fields. I can tell you that you won't notice a HUGE slowdown because you wont have any real volume, but a good DB design should not have that many fields in a table.

You may want to look into some beginning DB design, specifically about "normalization".

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 93 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.