SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member snowcrash's Avatar
    Join Date
    Feb 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL Database Design - Questions on optimization

    I am creating a database schema for a site we are currently working on. In the past, I have mainly used Access databases (I know, shame on me - they were easy!). I am now making the transition to MySQL, and attempint to tidy up my database creation practices in the meantime.

    My first question:
    I have a table for users setup as such
    userID
    userName
    userNameFirst
    userNameLast
    userAddress
    .....rest of physical info
    userEmail
    userSheme
    ....rest of site specific info

    Would it be better to create two tables, one with physical info, that will not be displayed, one with site info, that likely will be used each time or would it be just as fast to simply create to recordsets, to fetch differing records from the same table, or will it make any difference at all?

    My second question:
    We are going to be creating the site using CSS. At the moment, the CSS is to be stored inside a database in records designated with "Scheme" numbers. Using this model, the page will be loaded, get the username and their Scheme number, then the scheme table will be accessed and it's values plugged into an inline style sheet.
    My suggested model would be to store the schemes in a flat txt file (*.css) and simply pull in that file via an include. (ie, username is loaded, scheme is selected, css insert tags is written witht he location of the current style sheet (ie, Scheme4.css).

    Does anybody have any thoughts on which one would be faster, or am I looking at 6 of one and a half dozen of the other?

    Thanks,

    Jon

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,216
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    well, if you're going to store the css scheme files as flat text files, don't include them inline, link to them!

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member snowcrash's Avatar
    Join Date
    Feb 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are correct. I inadvertantly used "include" when I meant to use link. To clarify, we will either be using inline style sheets or linking to an external style sheet. If they are inline, they will be stored in a database. If they are stored externally they will be (obviously) *.css files. (ie, if I can find a method that allows an easy creation of css attributes and writes it to a text file) .

    Inline:
    <style type="text/css">
    <!--
    body {whatever;}
    -->
    </style>


    Link:
    <link href="common/css_Scheme1.css" rel="stylesheet" type="text/css">

    To re-state, I am questioning where it would be a performance hit to have the style sheet written out form a recordset at the beginning of everypage - will this effect the display of the page? I am in the middle of develpoing a page to test this, but if anybody has any input I would appreciate it.
    Last edited by snowcrash; Feb 7, 2006 at 14:12.


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
  •