当前在线人数12804
首页 - 分类讨论区 - 电脑网络 - 数据库版 -阅读文章
未名交友
[更多]
[更多]
文章阅读:Re: Re: 问个database design的问题
[同主题阅读] [版面: 数据库] [作者:NNYYCC] , 2007年06月15日14:33:28
NNYYCC
进入未名形象秀
我的博客
[上篇] [下篇] [同主题上篇] [同主题下篇]

发信人: NNYYCC (牙膏皮换糖), 信区: Database
标  题: Re: Re: 问个database design的问题
发信站: BBS 未名空间站 (Fri Jun 15 14:33:28 2007)

You still didn't answer my question in the first paragraph. So I assume that
your database is a transactional database and would make suggestions based
on this assumption.

Based on your additional info, you may want to add at least another table,
let's call it STOCK.

STOCK(STOCK_ID, STOCK_SYMB, STOCK_DESC, LAST_UPDATED)

With another two tables shown below:

TRADER(TRADER_ID, LAST_NAME, FIRST_NAME, STATUS, LAST_UPDATED)

STOCK_TRADE(TRADER_ID, STOCK_ID, TRADE_TIME, TRADE_VOLUME, TRADE_PRICE, LAST
_UPDATED)

Several assumptions:

1. The trade price for each stock varies for each trade.

2. You don't have any other tool to log your data change. That's why I added
the column "Last_Updated" to each table. But it is your decision whether or
not you want to have this column.

For the transaction table STOCK_TRADE, you might want to create indecies on
the trader_id and stock_id columns and partition your table based on either
trade_time or last_updated column. This will significantly improve your
performance.

Finally, if you use the database for reporting purpose, it will be another
story. You might not want to normalize your whole database this way. A
denormalized data warehouse would be a better option.

Good luck!

--

※ 来源:·WWW 未名空间站 海外: mitbbs.com 中国: mitbbs.cn·[FROM: 156.145.]

[上篇] [下篇] [同主题上篇] [同主题下篇]
[转寄] [转贴] [回信给作者] [修改文章] [删除文章] [同主题阅读] [从此处展开] [返回版面] [快速返回] [收藏] [举报]
 
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996