On 2011.12.18 1:50 PM, ehaerim wrote: > > I have 3000 symbols and each symbol will have a blob data everyday. > In one year, there will be 3000*365 blob records. > And I will insert these records per yearly database. ex)db_2011.fdb > > I am thinking of creating a table having (symbol_date, blob) structure. > So, the records will look like > (s0001_20110101, b0001_20110101) > ... > (s0001_20111231, b0001_20111231) > .... > .... > (s3000_20110101, b0001_20110101) > ... > (s3000_20111231, b0001_20111231) > > And my main most frequent query will be to find a record corresponding > to a symbol and a specific date. ex) (s_1004, b1004_20110728) > > Also main everyday insert will be to insert today's new record for > each symbol. That is 3000 inserts once everyday. > And everyday I will have to find the record having the most recent date. > > Two possible structures. > > [1] (Symbol, Date, Blob) => Symbol primary and Date is secondary key > [2] (Symbol_Date, Blob) => Symbol_Date is single primary key > > At the moment I was experimenting with [2] simply because of easiness. > > What structure would fit better in terms of performance and ease of > use? And why? > > thx > Why don't you use a table with: PK (bigint), Symbol, BusinessDate,YourBlob
This way could very easy group/sum what ever you want, by day,month,year, symbol...no need multiple databases. From your calculation is just 1 million records per year, firebird could easily manage this volume of data. Regards, -- Mercea Paul E-mail: paul.mer...@almexa.ro ___________________________________________ [Non-text portions of this message have been removed]