XF 2.2 Table or field?

Robert9

Well-known member
1.
For fewer forums, you allow threads and posts to be {special} = an integer, as example from 0 to 255.

We can add a field to xf_forum or we can add options and save the forum_ids?

Why should we add a new field here, any advantage over options?
Any reason to use the field, if we dont want to sort or filter forums?

2.
Because we may have only one forum to allow threads and posts to be special, we have only fewer threads to be special.
What do we do? Add a new field to threads or add a new table xf_thread_special to save thread_id and special_count?

Is there any reason for a new field for xf_thread, if we don't sort or filter and don't need the info in thread list?
One JOIN more in less forums VS one field in all threads?

What we do? Add field to xf_thread or table xf_special?


3.
We have some forums, we have many threads, we have many, many, many, many, many posts!
Same question here. Should we add a new field to xf_post or have a new table xf_post_special where we save post_id and special_count?

If we add a field we add it to many, many, many, many, many, many posts. But, because we normally view posts in a thread, it means that we need the JOIN for every post in such a thread.

For threads we need the JOIN only one time in thread_view, but for posts we need it 20 times for 20 posts in a thread.
What we do? Add a new field for many, many ... posts to avoid the JOIN for every post?


Less forums: options to mark one forum for special or add field to xf_forum?
one new field for less forums OR options for the add-on? Options are one query also, right?

Many threads: xf_thread_special or xf_thread_special?
new field for many threads or JOIN for one thread in thread_view?

Many, many ... posts: xf_post-special or xf_post_special?
new field for so many posts or JOIN 20 times per thread (but for less threads = only the ones in {special forums}


I guess the answer must be a new field every time, when we want to sort and filter?
I guess the answer must be a new field for threads, when we need the info in thread list?
I have no idea, what we do with posts. Small forum with fewer posts or large forum with a million posts?

And what we do, when we don't sort or filter and don't need the info in thread_list?



I can't find answers from add-ons.
I have seen add-ons adding many fields to posts and threads (where one field would be enough because we don't sort, filter, select).
I have seen add-ons that add a field to a post, but a table to extend threads.
 
Top Bottom