SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    London
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Strings Vs Table Size

    Hi,

    I am trying to decide on which is best. I have approximately 10,000 users whom make approxmiately 40 entries each into my database table would it be better to have each of the 40 entries in individual rows or as a string in one cell of a row? I really want to know the pros and cons for adding and referencing the data.

    Also, at what stage does a database table have too many rows or become unweildy?


    Thanks,

    Richard

  2. #2
    SitePoint Wizard swdev's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would never put more than 1 piece of data in a column, because this creates poblems in searching and retrieving that data.

    In terms of the number of rows in a table, that all depends on what hardware the server is running on, mainly memory and disk space.

    Just my $0.02 worth

  3. #3
    SitePoint Addict danfran's Avatar
    Join Date
    Jan 2005
    Location
    New York City
    Posts
    244
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is not unheard-of for tables to contain a hundred or two columns. A table 40 columns wide is perfectly acceptible, IMO.

    HOWEVER.. Consider the following hypothetical situation:
    You have a web site that surveys its users. Your survey application is standalone, and the surveys vary, but you decide to backup the querystring data (one big string..) in a table. -Then yes, one col for querystring, one for date, and one for surveyid/userid or something. To read the data, you simply read the name-value-pairs from the qstring field, do a split(), and you can then reference responses to surveys of any design structure.

    Simply put, consider why you're storing the data. (and tell us more, too)

    Dan

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    London
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a client table, clients can choose to optin for email alerts for specific events on specific dates.

    I was tring to decided whether to place a sting with a list of id's for each of the alerts in the client table or reference the client table to another tbale with a list of clientIDs and event alert ID's.

    I think I've now decided to opt for the later option.
    Thanks for you help.


    Richard


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
  •