[TYPO3-core] RFC: performance improvemenets for database
Dmitry Dulepov
dmitry at typo3.org
Tue Jan 30 10:07:11 CET 2007
Hi!
Ingmar Schlecht wrote:
> does anybody else have the problem I described in the quoted mail?
>
> Ingmar Schlecht wrote:
>> When I go to Update Database in the Install Tool, it always suggests...
>>
>> ALTER TABLE pages DROP KEY parent;
>> ALTER TABLE pages ADD KEY parent (pid, sorting);
>> ALTER TABLE tt_content DROP KEY parent;
>> ALTER TABLE tt_content ADD KEY parent (pid, sorting);
>>
>> ....no matter how often I click "Write to database", it stays there.
Yes, the problem exists as well as two other small problems:
- parent index is still defined as (pid) in t3lib/stddb. This is not
critical because it is overriden from cms extension but better be consistent
- be_users.lang is defined as varchar(2), which always becomes char(2)
in mysql. Here is what mysql manual says: "MySQL may silently change the
type of a CHAR or VARCHAR column at table creation time" [2] and
"VARCHAR columns with a length less than four are changed to CHAR" [1].
And about "CHAR" type: "When CHAR values are stored, they are
right-padded with spaces to the specified length. When CHAR values are
retrieved, trailing spaces are removed." [2] To avoid never disappearing
warning in COMPARE, we need to change that column as well.
To fix it all (including problem you mentioned) I recommend the attached
patch :)
Refs:
[1] http://dev.mysql.com/doc/refman/4.1/en/silent-column-changes.html
[2] http://dev.mysql.com/doc/refman/4.1/en/char.html
--
Dmitry Dulepov
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sql_compare_patch.txt
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070130/8a9ebc38/attachment.txt
More information about the TYPO3-team-core
mailing list