PDA

View Full Version : DB layout of 2.0



Mark Hewitt
Wed 22nd Nov '00, 12:34pm
May we also ask questions about how it works in this forum, or is that the other forum (move me if necessary)

I'm just wondering because someone said there is no post table. That being the case how are the posts stored?

Mike Sullivan
Wed 22nd Nov '00, 12:38pm
Correct, no post table. When I said that I meant there was literally no table named post.

I assume it's something like post1,post2 - maybe even thread1,thread2.

Mark Hewitt
Wed 22nd Nov '00, 12:41pm
Think I get it, creating a new table to copy the old stuff over into, thus less error prone than modifying the table directly.

Mike Sullivan
Wed 22nd Nov '00, 12:47pm
Basically each forum has it's own post (and possibly thread) table. This is good because MySQL only has table level locking, but that's only an issue if you have a ton of posts.

But yes, each table will be modified less often than one huge table.

Unfortunately, the update it going to probably take a long time.
SELECT * FROM post WHERE forumid=x;
INSERT INTO postx (blah) VALUES (blah)
DELETE FROM post WHERE forumid=x;

And loop that for each forum. :eek:
Of course, it'd be better to do smaller increments than that.

James
Wed 22nd Nov '00, 12:48pm
Hmm - this is a question for John I think... moving thread.

James

James
Wed 22nd Nov '00, 12:52pm
Saying that, the other forum needs to be kept a bug only zone... I'll move this thread back :)

Mike Sullivan
Wed 22nd Nov '00, 12:53pm
LOL, decisive. :)

James
Wed 22nd Nov '00, 12:59pm
;)

I've renamed the forum... now it makes more sense for these types of threads to stay here.

I'll also ask John to post an official answer to the db question.

All the best,

James

Brian
Wed 22nd Nov '00, 1:43pm
Also when the tables are updated their needs to be cycles which we can adjust. Otherwise you might get time outs and thus people are going to have some problems.. IE update xx at a time..


-Brian

shashi
Wed 22nd Nov '00, 1:53pm
if it is true that each forum has its own table for post, like postX then there will very soon be a limit on the number of forums you can have.

and god forbid if you have multiple installations of the VB on your machine (for multiple sites) then you can easily run out total number of table sopen in MySQL and total number of files open on the system!!

What it should do is to allow the admin to select the table postX (select value of X) for each forum, and default it to '0'

so if you don't specify any table number it goes to post0

you would need a small table for forums that has (i believe there is a table called forum or board) forum_name, forum_id, table_id

select table_id
into var_table_id
from forums
where forum_id = x;

$q = "select columns from " . var_table_id . " where ...";

then one could run this query $q;

since forums table will be pretty small and not change too often, this would pretty much sit in memory after a short while and thus will be inexpensive.

but please no one table per forum!