[cvs] [Wiki] changed: Project/Rdo

Chuck Hagenbuch chuck at horde.org
Tue May 27 22:23:47 UTC 2008


chuck  Tue, 27 May 2008 18:23:47 -0400

Modified page: http://wiki.horde.org/Project/Rdo
New Revision:  1.1
Change log:  notes on field sizes

@@ -73,8 +73,15 @@

 +++ Logging what Rdo does

 See "ror_logs.png" attachment.
+
+
++++ Database field sizing
+
+When possible, make varchar fields 2**n - 1 (255, etc). Internally (MySQL),
one extra byte is needed to store the length of the string. So when you add
the extra byte, the length is then an even power of two. This is desirable
for technical reasons. In particular, it ensures that the field will be on
an even word boundary given that eight byte words are used.
+
+Obviously, an exception is when the data in a field is inherently of a
particular length. For example, NYAuthUser.UserPass contains an MD5 hash of
the actual password. md5() always returns exactly 32 characters. So the
field should indeed be exactly 32 characters long - and thus a CHAR instead
of a VARCHAR. CHAR fields don't need the extra byte.


 +++ Paging



More information about the cvs mailing list