The following content is only an excerpt: If we design the topic table and reply table, the usual approach is as follows.
In this way, when obtaining the topic list, the paging algorithm is directly used to extract Topics; when viewing a certain post, you also need to jion links to Topics and Posts.
The flaws of this design are: 1. The Topics table stores Content content, and its volume will be very large. The performance of paging a large table will be very slow.
2. When displaying Posts content, a join operation will be performed, which will consume performance.
The approach of Discuz is to design as follows.
Split the Content in Topics into Posts, and at the same time, the topic posts of Topics are also placed in Posts as replies, thus solving the two problems we raised above. This is a classic example of violating a database design paradigm in exchange for better performance.
The above introduces the design of discuz friendly links php discuz theme table and reply table, including the content of discuz friendly links. I hope it will be helpful to friends who are interested in PHP tutorials.