Discuz! X2 attachment table sharding and topic image table Parsing

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.