MySQL question..

Discussion in 'Programming' started by sahilcoolsmart, Jul 26, 2007.

  1. #1
    Is there a limit on number of tables in a mysql database.
    And which way is better ?

    1. A lot of data in one table.
    2. Or small chunks of data in many tables.
     
    sahilcoolsmart, Jul 26, 2007 IP
  2. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #2
    You need to break up your data in logical small chunks which you put in a table.
     
    it career, Jul 26, 2007 IP
  3. sahilcoolsmart

    sahilcoolsmart Well-Known Member

    Messages:
    1,192
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Thanks for the reply,
    I am still looking for my the answer of my first question i.e Is there a limit on number of tables in a mysql database?
    I have seen one site with 30,000 tables.. how far this number can go?
     
    sahilcoolsmart, Jul 26, 2007 IP
  4. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #4
    Check database size limit in your host, add few tables,add few table entries
    and see how many bytes it is occupying now calculate how many table with how many entries can be fit in your database.
     
    it career, Jul 26, 2007 IP
  5. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #5
    "it career", he is talking about the possibility of going over 30,000 tables, surely he is not using a web host with a database size limit low enough to restrict him!

    If the data is homogeneous, then keep it one table. There are exceptions where dividing and querying with joins is more efficient but I don't know enough about that.

    As for the max number of tables, I doubt MySQL would have a limit. Table data is stored in directories so I guess the limit would be the number of sub directories you can have on your file system (billions... maybe more :)).
     
    krt, Jul 26, 2007 IP
  6. tbe

    tbe Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I'm pretty sure Mysql is just limited by the physical disk size of the hosting computer.
     
    tbe, Jul 26, 2007 IP