由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - A simple DB design question
相关主题
question on large tables (>=800 million records, 10 G bytes of data)how to see all the tables in SQL*PLUS?
请教三个Key的property,foreign key reference to two tables? how to do it?
Simple DB questionhow to list all tables in my account?
SQL求助Can I create thousands table in one...
relation table design question.请教用ACCESS做REPORT(TABLE & GRAPH)
sql questionOracle下如何能得到所有table的名字?
a question on database designanalyze 在oracle里怎么用?
求教...初级问题急问一个关于T-SQL的问题,谢谢
相关话题的讨论汇总
话题: table话题: db话题: question话题: history话题: simple
进入Database版参与讨论
1 (共1页)
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。。
1 (共1页)
进入Database版参与讨论
相关主题
急问一个关于T-SQL的问题,谢谢relation table design question.
interview question (SQL)sql question
sqldeveloper 怎么读一个tablea question on database design
fact table 和 dimension table 的区别到底是什么?求教...初级问题
question on large tables (>=800 million records, 10 G bytes of data)how to see all the tables in SQL*PLUS?
请教三个Key的property,foreign key reference to two tables? how to do it?
Simple DB questionhow to list all tables in my account?
SQL求助Can I create thousands table in one...
相关话题的讨论汇总
话题: table话题: db话题: question话题: history话题: simple