If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Financial Data Database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-08-08, 16:25
prent327 prent327 is offline
Registered User
 
Join Date: Jan 2008
Posts: 4
Financial Data Database

Hi, I'm a newbie here with limited knowledge of database design, so I appreciate any help in advance. I'm building out a database that is designed to store financial data for roughly 20-30k entities. For each entity I will store prices (avg. of 5,000 rows per entity) and data (avg. of 12,000 rows per entity). Both prices and data will generally be queried on an entity by entity basis, which would argue for creating separate tables for each entity, but they will also sometimes be queried and analyzed in other ways. I guess my two questions are is there a limitation to the number of tables in a database and how best does one manage potentially tens of thousands of tables? and for other complicated queries would I use joined tables and how exactly do those work? Thanks.
Reply With Quote
  #2 (permalink)  
Old 01-08-08, 19:21
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
use one table for all entities, i.e. one table for prices, a second table for data

separate sets of tables for each entity is inviting heartache, frustration, and ultimately sheer chaos
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 01-08-08, 19:26
prent327 prent327 is offline
Registered User
 
Join Date: Jan 2008
Posts: 4
Wouldn't that make a query and display incredibly time consuming though? It would result in a table with perhaps 360 million rows.
Reply With Quote
  #4 (permalink)  
Old 01-09-08, 05:19
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 770
As opposed to the magical guess process so finding the right table?
It all depends on your indexes/keys and what data you're looking for (a where clause always helps).

Tell me with separate tables how you expect to concatentate all the results for the top 20 "entitites" ?
Reply With Quote
  #5 (permalink)  
Old 01-09-08, 09:46
prent327 prent327 is offline
Registered User
 
Join Date: Jan 2008
Posts: 4
My plan was to have an index table that lists general information on each entity, including an identifying number. Then each price and data table will be a concatenation of the identifying number and the word "price" or "data", making finding the specific table needed easy. As for running queries across tables, that's obviously where this structure becomes a problem and I was hoping a joined table might work.
Reply With Quote
  #6 (permalink)  
Old 01-10-08, 02:57
RBARAER RBARAER is offline
Registered User
 
Join Date: Aug 2004
Location: France
Posts: 754
Quote:
Financial Data Database
Quote:
Hi, I'm a newbie here with limited knowledge of database design
I don't blame you, but knowing that you are a newbie and that you have to deal with millions of rows of financial (that is, very very important) data, you should IMO tell your boss that he NEEDS to hire someone who KNOWS database design. I don't say that you can't learn how to do and that we cannot help you, it will take months before you can design database schemas correctly (and knowing why), enforce all needed constraints and optimize data access / batch processing for so many rows... Furthermore, you are on your own ! With someone having years of experience beside you, it would be : much quicker / much better for your boss and much quicker for you to learn.

As for your question, as it already has been said, you should never had even thought of "tens of thousands of tables". Never EVER, even in your worst nighmares .

That being said, if you want us to help you with your design, please be more precise on your needs : entities and relationships (as you think they should be for now), fields, other constraints...

HTH & Regards,

rbaraer
__________________
ORA-000TK : No bind variable detected... Shared Pool Alert code 5 - Nuclear query ready .
Reply With Quote
  #7 (permalink)  
Old 01-10-08, 11:53
prent327 prent327 is offline
Registered User
 
Join Date: Jan 2008
Posts: 4
Thanks for the reality check rbaraer. Unfortunately, this is my own project, so I'm on my own. Rather than pester the forum with dozens of questions, I'll seek out some outside consultancy help.
Reply With Quote
  #8 (permalink)  
Old 01-11-08, 04:20
RBARAER RBARAER is offline
Registered User
 
Join Date: Aug 2004
Location: France
Posts: 754
Quote:
Originally Posted by prent327
Thanks for the reality check rbaraer. Unfortunately, this is my own project, so I'm on my own. Rather than pester the forum with dozens of questions, I'll seek out some outside consultancy help.
That seems a wise decision to me. Yet, I hope I won't have discouraged you from asking questions on this forum : if you have questions in the future, don't hesitate !

Maybe Rudy (r937) can help you as a consultant ?

Anyway, good luck in your project !

Regards,

rbaraer
__________________
ORA-000TK : No bind variable detected... Shared Pool Alert code 5 - Nuclear query ready .
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On