发信人: 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
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
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.
※ 来源:·WWW 未名空间站 海外: mitbbs.com 中国: mitbbs.cn·[FROM: 156.145.]