[TYPO3-dev] Default definitions of database fields
Susanne Moog
typo3 at susannemoog.de
Thu Feb 11 18:22:23 CET 2010
Am 11.02.2010 17:45, schrieb Jochen Rau:
> Hi.
>
> Currently the traditional kickstarter produces default field definitions
> like.
>
> starttime int(11) DEFAULT '0' NOT NULL,
>
> These are used by nearly every extension the last few years. As I write
> the documentation for Extbase now, I want to collect best-practice
> solutions and there came up some questions:
>
> Why do we use (11) after int, tinyint? As this makes perfect sense for
> char and varchar, it is IMO useless for int and tinyint because it does
> NOT indicate how many numbers or bytes the field can hold. It just fills
> the integer up with zeroes on the left. A 42 stored in an int(11) field
> is stored as 00000000042. (Don't ask why "42" ;-) )
I'm not really shure but if I remember correctly mySQL uses the (11) for
the size of the field on a temporary join. So you can make temporary
joins faster with limiting the char count of the chars displayed. I
don't know if that matters for TYPO3 at all, just thought I remember it
that way.
Best regards,
Susanne
More information about the TYPO3-dev
mailing list