#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    CA
    Posts
    3
    Rep Power
    0
    Hi.

    i'd been looking forward to getting into DBMS work, but i keep getting stuck at not knowing how to figure out the lengths or widths that should be set for fields or columns.


    seems like:
    o too small, and you've cut off some data
    o too big, and you're wasting storage-space (and maybe lagging the db on the performance side?), especially if you get a massive number of rows.

    seems better to choose towards "too big" fields or columns, but what to you guys use for figuring this out?

    (guessing there's no field-sizes sliderule, but hoping to get something enough to get over this hook.)

    thanks.

    --
    sc
    --


  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Copenhagen, , Denmark
    Posts
    20
    Rep Power
    0
    If you are talking about strings? ... just use VARCHAR() - they won't waste space.

    ... Sooo defining a VARCHAR(250) field wont't take up 250 bytes - only the bytes the string is long ...
  4. #3
  5. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,642
    Rep Power
    4476
    CHAR() columns store the exact width you define them as.


    You can use TEXT or BLOB and not waste space, right? It only stores the length of the text plus one byte for end of string...

    ---John Holmes...

Similar Threads

  1. setting default values in column field
    By arthats in forum MySQL Help
    Replies: 1
    Last Post: February 9th, 2004, 10:20 PM
  2. Table variable column widths
    By coredumped in forum HTML Programming
    Replies: 2
    Last Post: February 2nd, 2004, 10:31 PM
  3. MyAdmin Column Widths
    By netroact in forum MySQL Help
    Replies: 0
    Last Post: January 31st, 2004, 06:52 PM
  4. return value from 3 fields into 1 field
    By denali in forum MS SQL Development
    Replies: 1
    Last Post: December 19th, 2003, 07:44 AM
  5. Validating a field with multiple criteria...
    By brotherloco in forum Java Help
    Replies: 0
    Last Post: October 29th, 2003, 07:40 AM

IMN logo majestic logo threadwatch logo seochat tools logo