I have a message board on my site that uses mysql and am trying to optimize the database to use the least resources on my server.
My tables look like so;
Users (Username, Password, Pin, Email, Type)
Username = char(20) NOT NULL PRIMARY KEY
Password = char(20) NOT NULL
Pin = int(4) NOT NULL
Email = char(60) NOT NULL
Type = int(1) NOT NULL
Posts (PostID, ParentID, Children, DateTime, Username, Subject, Title, Body)
PostID int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY
ParentID int(10) NOT NULL DEFAULT 0
Children int(4) NOT NULL DEFAULT 0
DateTime TIMESTAMP NOT NULL
Username char(20) NOT NULL
Subject int(1) NOT NULL DEFAULT 0
Title char(100) NOT NULL
Body text
Am I better to store the message body (currently in Posts) in a separate table because it is not a fixed size and can be anything from 0 to 5000 character long?
Or should I make it a char column with a fixed size of 5000 characters?
My site is running on a shared server.