ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Several reasons for using varchar2 instead of char:

Several reasons for using varchar2 instead of char:

原创 Linux操作系统 作者:xhailiang 时间:2007-07-28 00:00:00 0 删除 编辑
Several reasons for using varchar2 instead of char: 1. char (xx) will always rpad data with blanks. This is a guarantee for surprises when comparing data and using indexes for searches because implicit conversion strikes. Please look up the rules for implicit conversions. 2. A value of char will always consume full space in the database because it is padded. Therefore, indexes grow bigger and searches are slower. 3. As opposed to a wide-spread misunderstanding, char (1) does *not* use less space in the database than varchar2 (1) when the value 'a' is stored because also char (1) has a length field. This can be proved by the dump () function.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/308563/viewspace-171999/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-02-17

  • 博文量
    270
  • 访问量
    425173