比如我有很多小说。
有两张表:小说信息表和小说章节表。
小说信息表存储了小说的id,标题,字数,作者啊等等。
小说章节表存储所有小说的章节及其内容。该表用小说id+章节id共同作为主键。
我的问题是,这样建表好吗? 要查找一篇小说的所有章节时会不会太慢了?
巴扎黑2017-04-17 15:06:50
It is recommended not to store content in the database. You can write to a file and put it on a certain server, and only the accessible file addresses will be stored in the database.
迷茫2017-04-17 15:06:50
Then vertically split the novel chapters and novel content into separate tables. If it is still slow, consider indexing and full-text indexing.