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 > Database design - how to?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-09-06, 07:44
kanakana kanakana is offline
Registered User
 
Join Date: Dec 2006
Posts: 2
Database design - how to?

Hi

This is my first post.
I need a help on db designing for one requirement.

1.) For a domain name i will be collecting three statistics every day for one year.

I thought of creating table for a domain name with each column (for each date). These column will point to a table which willl contain three statistics of a day. But i feel that is an inefficient way of doing as the tables will grow up over the years.

Any pointer how can i tackle this requirement.

TIA
Reply With Quote
  #2 (permalink)  
Old 12-09-06, 13:46
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
absolutely inefficient.

show us the columns you are needing to collect data for and add a date column.

we can help you from there if any further refinements are necessary
Reply With Quote
  #3 (permalink)  
Old 12-09-06, 16:22
Yveau01 Yveau01 is offline
Registered User
 
Join Date: Dec 2005
Location: Tilburg, Netherlands
Posts: 73
Totaly agree with guelphdad ...
One statistic three times a day, or three different statistics each day ? I suppose the latter ...

But here just a hint how to anyway:

1. Being more than 200% sure, the requirements will not change ... (or 'just forget it, when they see it working they want more !')
Create a single table:
Date, Item1, Item2, Item3

2. Willing to add some db know how and be the laughing system owner when they want more.
Create three tables:
- one for storing domain characteristics like name, owner, etc. Make sure to include an ID as primary key, say DomID.
- one for storing the type of statistics you want to measure, again make sure there is an StatID as primary key field in this table.
- one for storing the actual measurements of the different statistics, including a foreign key to the first two tables by using the DomID and StatID. Ofcourse don't forget to store the date (or better date and time) here as well.

Putting this last option into a 'schema':


+-----+-----+----+
|DomID|Name |... |
+-----+-----+----+

+------+-----+----+
|StatID|Name |... |
+------+-----+----+

+-----+------+-----+-----+------+
|DomID|StatID|Date |Time |Value |
+-----+------+-----+-----+------+


... and now let the users come tell you they want you to monitor more than one domain or another 700 statistics of those 429 domains they own. You'll be ready for them ... at least, that's what I would do ...

Gr,
Yveau
__________________

> SELECT * FROM users WHERE clue > 0;
Empty set (0.00 sec)

Reply With Quote
  #4 (permalink)  
Old 12-10-06, 00:37
kanakana kanakana is offline
Registered User
 
Join Date: Dec 2006
Posts: 2
THanks yveau01

THanks yveau01, thats what iam looking for.

Before looking into your design, i have myself designed almost same design, but without the second table.

+------+-----+----+
|StatID|Name |... |
+------+-----+----+

But adding your second table, gives me the flexibility ofadding new statistics to be collected.

Again thanks.
Reply With Quote
  #5 (permalink)  
Old 12-11-06, 13:29
Yveau01 Yveau01 is offline
Registered User
 
Join Date: Dec 2005
Location: Tilburg, Netherlands
Posts: 73
Glad I could help you out ... after all, that's why we're all here for !

Gr,
Yveau
__________________

> SELECT * FROM users WHERE clue > 0;
Empty set (0.00 sec)

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