By Steve Kraft on Tuesday, 09 February 2021
Posted in Technical Issues
Replies 3
Likes 0
Views 620
Votes 0
Hi there,

this is just a question of understanding.

After an update from j2.5 to j.3.9 there is a new DB table
_discuss_thread. Now we have about 92,000 posts and about 27,000 threads.

In the thread and post table the same contents are present - title, the question, etc. - Why is this all repeated in the thread table?

Is this just a temporary solution until the new ED version arrives?

All the best,
Steve
Is this just a temporary solution until the new ED version arrives?

Nope, this thread table is very important to use for optimizing the page performance, from the SQL query wise we do not need to scan through all the row data which including the replies from the post table.

Imagine now we do not have this thread table, then when the user access the recent discussion page, it actually will scan through the post table for all of your current 92,000 records (included replies) and see which discussion post should show on the page base on the certain discussion/category privacy.

So the page load will become extremely slow and of course if the post table only a few thousand records then you might not see the big impact.
·
Wednesday, 10 February 2021 10:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

first of all thank you for going into this.

This is why I asked if this is a temporary situation, let me explain.

On 2.5 we didn't have a _tread table yet, now this table is added and all newly initiated posts have an additional memory location. I see no added value here and here is my explanation why:

Before, I "only" had about 92,000 table rows. Now I have about 26,000 more in my database. What is the purpose of this?

Threads and posts have the same content, except for a few columns?

Posts: title, alias, created, modified, replied, content, published, ordering, vote, hits....
Threads: title, alias, created, modified, replied, content, published, ordering, vote, hits....

Why do these columns have to be included in both tables?

So why aren't posts just completely split into threads and replies? And in the "posts" table there are only the markers where to find what.

That was why I asked if this is a temporary situation and will be changed later in a new ED version.
·
Wednesday, 10 February 2021 14:47
·
0 Likes
·
0 Votes
·
0 Comments
·
That was why I asked if this is a temporary situation and will be changed later in a new ED version.

Nope, this is the permanent solution for now.

On 2.5 we didn't have a _tread table yet, now this table is added and all newly initiated posts have an additional memory location. I see no added value here and here is my explanation why:

Before, I "only" had about 92,000 table rows. Now I have about 26,000 more in my database. What is the purpose of this?

Threads and posts have the same content, except for a few columns?

Posts: title, alias, created, modified, replied, content, published, ordering, vote, hits....
Threads: title, alias, created, modified, replied, content, published, ordering, vote, hits....

Why do these columns have to be included in both tables?

So why aren't posts just completely split into threads and replies? And in the "posts" table there are only the markers where to find what.

The main purpose of this is to improve page performance.

The reason why both tables have similar columns is that from SQL query wise you can execute it very fast to get the value you want.

Hmm, what I can say is not every single issue we can predict in the future, so sometimes we only can know the issue when the table row data become huge.

If I recall correctly, the reason why we added this thread table is because some of the user sites have more than 7 million data then we only found out that if everything store into one single table then it will make the query execute very heavy while cause the page performance issue badly, so the page loading time might be around 10~ 20 seconds.

So this is why the thread table exists after you upgrade from Easydiscuss 2.x and this is not an easy task to split the thread and replies into a different table if the whole system already relies on the post table earlier.

Unless when you build a new forum extension then you probably will know what kind of issue comes into your mind before developing it since we have the experience for this now.
·
Wednesday, 10 February 2021 17:36
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post