|
-
Dec 30th, 2007, 05:09 PM
#1
Thread Starter
WiggleWiggle
[RESOLVED] Forum Help - Thread/Post Storage
I am making a small forum for my website and i am not sure of the best way to store posts and threads.
Should i store them all in one table and just have a field "parent" that if it is blank it must be a thread and if not, it is a post.
Or should they be in separate tables?
I think that when they are together it makes it easier for me to count the number of posts and thread on the main forum page.
http://www.rapidfriends.com/forums.php That is what i have so far.
My usual boring signature: Something
-
Dec 30th, 2007, 05:44 PM
#2
Thread Starter
WiggleWiggle
Re: Forum Help - Thread/Post Storage
never mind! i decided to go with them all in the same table.
rep was distributed accordingly
My usual boring signature: Something
-
Dec 31st, 2007, 05:01 AM
#3
Re: [RESOLVED] Forum Help - Thread/Post Storage
I thought I replied to this last night. In my imaginary reply I said that you should put them in two tables. It will reduce redundancy and overhead (i.e: when moving threads).
It also means it is more normalized.
-
Jan 1st, 2008, 12:53 AM
#4
Re: [RESOLVED] Forum Help - Thread/Post Storage
Threads are not posts. They must be in separate tables. The data that you store in each case is quite different.
-
Jan 1st, 2008, 05:05 AM
#5
Re: [RESOLVED] Forum Help - Thread/Post Storage
FroumID, Number Of Replies, Thread Starter, Post Time, Rating, Deleted Flag
All those are the data you are likely to find in a thread.
-
Jan 1st, 2008, 05:35 AM
#6
Re: [RESOLVED] Forum Help - Thread/Post Storage
And the title, of course.
Mind you, I'd be inclined to omit the 'number of replies' field, and use an aggregate instead.
-
Jan 1st, 2008, 05:49 AM
#7
Re: [RESOLVED] Forum Help - Thread/Post Storage
 Originally Posted by penagate
And the title, of course.
Mind you, I'd be inclined to omit the 'number of replies' field, and use an aggregate instead.
Duplication in favour of efficiency.
-
Jan 1st, 2008, 05:53 AM
#8
Re: [RESOLVED] Forum Help - Thread/Post Storage
Bah. Not worth it for a count field.
-
Jan 1st, 2008, 06:04 AM
#9
Re: [RESOLVED] Forum Help - Thread/Post Storage
Certainly is - a single SQL query creates a lot of overhead. In a forum it is better to do that during the update rather than the recall.
-
Jan 1st, 2008, 07:38 AM
#10
Re: [RESOLVED] Forum Help - Thread/Post Storage
Disagree. Row count is a quick lookup. Also, executing it as a single query would be foolish. It would be done as part of the query to fetch the list of threads for a forum. Nil overhead.
-
Jan 1st, 2008, 01:11 PM
#11
Re: [RESOLVED] Forum Help - Thread/Post Storage
If you are just fetching a list of threads you do not need a relational link to the posts table. If you want to count the number of posts in the thread you'd need to link up with the table and consequently deal with more records.
Assuming anyone actually replies to the thread.
-
Jan 1st, 2008, 07:28 PM
#12
Thread Starter
WiggleWiggle
Re: [RESOLVED] Forum Help - Thread/Post Storage
ok thanks you guys for the replies, but this is just a tiny little forum for my small site. i dont need anything fancy. All deletes are deleted right away, i dont need any bells and whistles added. 
One table works fine for me.
My usual boring signature: Something
-
Jan 1st, 2008, 09:45 PM
#13
Re: [RESOLVED] Forum Help - Thread/Post Storage
 Originally Posted by visualAd
If you want to count the number of posts in the thread you'd need to link up with the table and consequently deal with more records.
Actually, you're right. I wasn't thinking, but you would need a predicate to count the replies. I suppose my logic only makes sense if each thread had its own table of replies, which would be idiocy.
 Originally Posted by visualAd
Assuming anyone actually replies to the thread.
I'm sure dclamp can reply to his own threads.
-
Jan 1st, 2008, 10:01 PM
#14
Re: [RESOLVED] Forum Help - Thread/Post Storage
Why have a "forums" on a social networking site? Seems illogical.
"RabidFriends" Is it a site for friends with th rabies?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 1st, 2008, 11:24 PM
#15
Thread Starter
WiggleWiggle
Re: [RESOLVED] Forum Help - Thread/Post Storage
 Originally Posted by RobDog888
"RabidFriends" Is it a site for friends with th rabies? 
deja-vu... yes, rabid people come together and talk about their stories...
My usual boring signature: Something
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|