1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

MySQL # of Tables

Discussion in 'MySQL' started by a389951l, May 13, 2005.

  1. #1
    I have a script that produces a table for every user - relatively small table for each user. My hosting company is telling me that is causing performance issues with the mysql server. I am not a mysql expert so I know that it is inefficient to have all of these tables but my host is shutting me down for this reason.

    So, mysql experts I would like to know if my host is feeding me bull or not.

    Thanks...
     
    a389951l, May 13, 2005 IP
  2. dct

    dct Finder of cool gadgets

    Messages:
    3,132
    Likes Received:
    328
    Best Answers:
    0
    Trophy Points:
    230
    #2
    Depends how many users you have, does seem like a very odd database design what are you storing in each table :confused:
     
    dct, May 13, 2005 IP
  3. frankm

    frankm Active Member

    Messages:
    915
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    83
    #3

    No, your host is right.
    every table , even an empty one, needs 3 files. (Data, Index and Structure).
    I created a stupid table with just " id int; ":
    -rw-rw---- 1 mysql mysql 0 May 14 00:27 bla.MYD
    -rw-rw---- 1 mysql mysql 1024 May 14 00:27 bla.MYI
    -rw-rw---- 1 mysql mysql 8550 May 14 00:27 bla.frm

    that's giving me 3 files.
    MYD => Data, empty
    MYI => Index , already 1kb,
    frm => table structure 8kb.

    If you would create 10000 EMPTY tables, you will be using 10000 * (1+8) = 90.000 KB == 90 MB of data.
    That's a lot of bytes for storing no useful data :)

    You'd better create one table with a (primary) key, something like
    username char(16),
    fill this field with the name you were giving to the table now, and your host will be pleased


    g'luck
     
    frankm, May 13, 2005 IP
  4. a389951l

    a389951l Must Create More Content

    Messages:
    1,885
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    140
    #4
    I know lol. I bought the site and it had this script already. I am looking to change the code.
     
    a389951l, May 13, 2005 IP