m******i 发帖数: 6 | 1 现有一个table存放书籍,需要单独列出几本(<10)来推荐,每天更新。
问题:是专门用一个field来标记好呢,还是另外建一个table好呢? | a*******t 发帖数: 891 | 2 don't really understand your question/requirement. for example, any
performance consideration?
but I'll try to answer
I think the logical deisgn would be to build a new table, and only store the
daily recoomendation list, with forigen key referrance to the main table.
if performance is an issue, I would actually copy the full contents of the
fields to the recommendation table
and do you need to keep track of the history of the "recommended"?
【在 m******i 的大作中提到】 : 现有一个table存放书籍,需要单独列出几本(<10)来推荐,每天更新。 : 问题:是专门用一个field来标记好呢,还是另外建一个table好呢?
| d*****l 发帖数: 8441 | 3 Agree.
the
【在 a*******t 的大作中提到】 : don't really understand your question/requirement. for example, any : performance consideration? : but I'll try to answer : I think the logical deisgn would be to build a new table, and only store the : daily recoomendation list, with forigen key referrance to the main table. : if performance is an issue, I would actually copy the full contents of the : fields to the recommendation table : and do you need to keep track of the history of the "recommended"?
| x***e 发帖数: 2449 | 4 Assail got your key.
No matter what you need, 专门用一个field来标记 won't be a good idea.
IF you want to do so, you can build a view for the recommended, and add the
column you want into the view.
You will keep the ref integraty and the performance in your mind.
Also, for the recommended history, in case you want, you want to use the
dimentional/fct model, the dimentional table will be your book table, and
keep the id with the history to build the transctional history fct table.
【在 m******i 的大作中提到】 : 现有一个table存放书籍,需要单独列出几本(<10)来推荐,每天更新。 : 问题:是专门用一个field来标记好呢,还是另外建一个table好呢?
| q**1 发帖数: 193 | 5 你要的就是一个query,根本不需要什么新表和新的field。。
【在 m******i 的大作中提到】 : 现有一个table存放书籍,需要单独列出几本(<10)来推荐,每天更新。 : 问题:是专门用一个field来标记好呢,还是另外建一个table好呢?
| t*****g 发帖数: 1275 | 6 Yes, cache the result in your application instead of database.
【在 q**1 的大作中提到】 : 你要的就是一个query,根本不需要什么新表和新的field。。
|
|