1. Background:
In discuz! In X2, the original attachment table and one attachment description table are combined and then divided into 11 tables, which greatly enhances the Forum's support for the attachment data volume, at the same time, server load is high when there are many attachment records.
At the same time, a topic image table is added. If a topic's main poster is attached with an image attachment, the graph with the largest width in the attachment will be written to this table.
2. Explanation of the attachment table:
Pre_forum_attachment
|
Attachment index table |
Pre_forum_attachment_0 |
Attachment sub-Table 0 |
Pre_forum_attachment_1 |
Attachment table shard 1 |
... |
... |
Pre_forum_attachment_7 |
Attachment table 7 |
Pre_forum_attachment_8 |
Attachment table sharding 8 |
Pre_forum_attachment_9 |
Attachment table 9 |
Pre_forum_attachment_unused |
Unused attachment table |
Pre_forum_threadimage |
Topic image table |
Where
Pre_forum_attachmentThe table is used as an index to store the attachment ID and actual attachment information. The data stored in the table includes
Attachment ID, topic ID, post ID, table sharding ID, number of downloads
Pre_forum_attachment _ {1-9}A table is a real data table for storing attachments. The data includes all the information in the original attachment table, as well as the data in the original attachment table, such as the attachment description. Here, the last TID of the topic determines the table shard in which the attachment is saved.
Pre_forum_attachment_unusedThe table is saved and uploaded when posting a post, but no attachments are successfully posted.
Pre_forum_threadimageThe table stores an image with the largest width in the Image Attachment attached to a topic. The function of this image is that when the DIY module calls the post module to select an image attachment, the displayed image is directly queried from this table. At the same time, the recorded images in each table also exist as the topic cover of the image mode.