Results 1 to 4 of 4

Thread: assigning the length of ID field on a table

  1. #1
    Join Date
    Oct 2005
    Posts
    13

    assigning the length of ID field on a table

    dear all,
    I've an argue with my friend about assigning the length of our ID field on master table. We have a few master tables and my friend wants to make the same the length of those ID fields into char(30) although there are some IDs wouldn't reach that length.
    I refuse his idea because two reason : disk space usage and performance.
    I just want to know any idea of you ? who's supposed deal with who ?
    thanks in advance,

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    What's the length of majority ids? Keep in mind that varchar type needs couple of bytes overhead and rdbms has to do some calculation to get its position in the row.

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    In most RDBMS if you use numeric data type like int, bigint etc.. you could save lot of space and it is faster. Clustered index based on that numerical column and all covering index uses the numerical clustered column.

  4. #4
    Join Date
    Oct 2005
    Posts
    13
    @ rmiao
    the length of majority ids were between 6 - 10, based on your opinion I'm supposed to be the right one, right ? I'm affraid if my friend's idea would be implemented so the query of reports would take a long time to display

    @ MAK
    Our tables structure were done, in the next we just want to resize the length of IDs therefore we can't use numeric data type on it but my datawarehouse design would be consider that, thanks MAK

Posting Permissions

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