Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2006
    Posts
    2

    Unanswered: 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

  2. #2
    Join Date
    Mar 2004
    Posts
    480
    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

  3. #3
    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)


  4. #4
    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.

  5. #5
    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)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •