Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    2

    Post Unanswered: varchar and char

    i would like to know if there is an overhead in using VARCHAR when you use to store it...

    a colleague of mine claims that if the field is defined to be VARCHAR the system creates and additional column DOUBLE/DECIMAL with storage size of 17/18bytes.

    such that if the size of the varchar field is less than 30 it is better to be defined as CHAR instead.

    please help me out here... i think there's something wrong with his statement, but i need concrete proof to it... a link to page or pdf file would be very much appreciated.

  2. #2
    Join Date
    Nov 2003
    Posts
    94
    The overhead on a variable length data field is 2 bytes per column in the rowset. The data space required is always allocated for a fixed length field, plus an additional portion of the row, known as the null bitmap is allocated to handle column nullability which works out as 2 + Integer of (( <Number of fixed length Columns> + 7) / 8 ).

    Look up 'size of table' in Books on line.

    Given one varchar field of (30) per row with an average fill of 15 chars the dataspace will average 17 bytes per row. A fixed char (30) will use 33 bytes per row.

  3. #3
    Join Date
    Feb 2004
    Posts
    2
    thanks ...

    this cleared up a lot of things

Posting Permissions

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