hi, I decided to build a quick forum system for my site. nothing too advanced...heres the db setup i have.
create table ForumsTopics
(
id int auto_increment not null,
topic_id varchar(7) not null,
title char(100) not null,
cat char(1) not null,
views char(6) not null,
date DATETIME not null,
last_mod TIMESTAMP not null,
PRIMARY KEY (id)
);
create table ForumsThreads
(
id int auto_increment not null,
username varchar(16) not null,
topic_id varchar(16) not null,
message varchar(7500) not null,
created DATETIME not null,
last_modified TIMESTAMP not null,
PRIMARY KEY (id)
);
I realized I don't need two seperate tables, ForumTopics & ForumThreads.
By setting it up in two tables, I will have to select from two tables to retrieve the topic title and message when displaying the message page. But when viewing the forum topics page, I will need to select from one table.
I want to design this so its as efficient as possible, and memory storage is not a problem. Meaning, I want a database setup that will sacrafice space rather then processesing speed.
Now if I decide to make just one table to include the topic , category , message body , etc. then all my SELECTS will only need to select from ONE table. But if this application was built to serve thousands viewing at the same time, then would having two tables help efficiency since it will reduce the loads?
Thanks for taking your time to read this.
Cheers,
Bobby