SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: DB design

  1. #1
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,810
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    DB design

    'ello Gurus

    Am dbing a site at the mo and am nearly there, just have a question concerning structure.

    The type of info I am displaying can be found here.

    Currently, I have all info regarding venues (locID, name, type, photo1url, photo2url, disfac, leisfac, info, additional, logo) in one table (where disfac is Disabled Facilities and leisfac is Leisure facilities.

    Information regarding "suites" is stored in a seperate table as there can be a variable number of them.

    The last part is troubling me (on the page, the bit that refers to No. ensuite bedrooms etc).
    Because of the amount of data, I have an urge to put it in a seperate table. However, structurally I can see no reason why this data can't be in the first table - that would make it fetch data faster right?

    Any advice as always appreciated!

    H
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  2. #2
    You want what? By when?? Milamber's Avatar
    Join Date
    Jan 2001
    Location
    California
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you have no reason to put things in separate tables, don't then. I know that running separate queries will increase load time. However, if you had it in separate tables and did a single query of the join type, it might be just as fast, but why bother to use the more complex, confusing code, when you can easily make a single table nice and neat?
    -Jeff Minard | jrm.cc - Battlefield 2 Stats

  3. #3
    SitePoint Addict DevilBear's Avatar
    Join Date
    Oct 2001
    Location
    Hades
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fight the urge :)

    I agree with you, I can see no reason to put that data in a separate table.

    I'm curious about the disfac and leisfac columns, though. Exactly what do they store? I know they're for the facilities, but what's in those columns and how does it get translated into the icons on the webpage? Just wondering if those shouldn't be in a different table as it looks like you have a 1-to-many relationship there.

  4. #4
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,254
    Mentioned
    113 Post(s)
    Tagged
    1 Thread(s)
    If you have a one to many relationship OR if you have a large amount of data (ie you need to store it in a memo field), then move it to another table. Otherwise leave it in the same table.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  5. #5
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,810
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Fight the urge :)

    Originally posted by DevilBear
    I'm curious about the disfac and leisfac columns, though. Exactly what do they store? I know they're for the facilities, but what's in those columns and how does it get translated into the icons on the webpage? Just wondering if those shouldn't be in a different table as it looks like you have a 1-to-many relationship there.
    Heh, I deliberated over this one as well, discussion right here .

    I am leaning towards the flat table option, but then something else occured to me. If in the future I want to build in functionality to search for events by No. of bedrooms, nearest airport, whatever, would the data not be better in a seperate table for expedient searching?

    I don't know whether this functionality will be required (it hasn't been requested), and in any event, there are only 60 or so facilities - so maybe I shouldn't dwell too much.....

    Cheers guys,

    H
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS


Bookmarks

Posting Permissions

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