Project

General

Profile

Actions

Task #82671

closed

Remove duplicate database indexes

Added by Alexander Grein about 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Performance
Target version:
-
Start date:
2017-10-04
Due date:
% Done:

100%

Estimated time:
1.00 h
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
easy
Sprint Focus:

Description

Checking a typical typo3 8.7 database, using the percona toolskit (https://www.percona.com/software/database-tools/percona-toolkit) command "pt-duplicate-key-checker", gives me the following result:

  1. ########################################################################
  2. typo3.index_words
  3. ########################################################################
  1. Key metaphone ends with a prefix of the clustered index
  2. Key definitions:
  3. KEY `metaphone` (`metaphone`,`wid`)
  4. PRIMARY KEY (`wid`),
  5. Column types:
  6. `metaphone` int(11) not null default '0'
  7. `wid` int(11) not null default '0'
  8. To shorten this duplicate clustered index, execute:
    ALTER TABLE `typo3`.`index_words` DROP INDEX `metaphone`, ADD INDEX `metaphone` (`metaphone`);
  1. Key baseword ends with a prefix of the clustered index
  2. Key definitions:
  3. KEY `baseword` (`baseword`,`wid`),
  4. PRIMARY KEY (`wid`),
  5. Column types:
  6. `baseword` varchar(60) not null default ''
  7. `wid` int(11) not null default '0'
  8. To shorten this duplicate clustered index, execute:
    ALTER TABLE `typo3`.`index_words` DROP INDEX `baseword`, ADD INDEX `baseword` (`baseword`);
  1. ########################################################################
  2. typo3.sys_category
  3. ########################################################################
  1. parent is a left-prefix of category_list
  2. Key definitions:
  3. KEY `parent` (`pid`),
  4. KEY `category_list` (`pid`,`deleted`,`sys_language_uid`)
  5. Column types:
  6. `pid` int(11) not null default '0'
  7. `deleted` smallint(6) not null default '0'
  8. `sys_language_uid` int(11) not null default '0'
  9. To remove this duplicate index, execute:
    ALTER TABLE `typo3`.`sys_category` DROP INDEX `parent`;
  1. ########################################################################
  2. typo3.sys_domain
  3. ########################################################################
  1. parent is a left-prefix of getDomainStartPage
  2. Key definitions:
  3. KEY `parent` (`pid`),
  4. KEY `getDomainStartPage` (`pid`,`hidden`,`domainName`)
  5. Column types:
  6. `pid` int(11) unsigned not null default '0'
  7. `hidden` smallint(5) unsigned not null default '0'
  8. `domainname` varchar(80) not null default ''
  9. To remove this duplicate index, execute:
    ALTER TABLE `typo3`.`sys_domain` DROP INDEX `parent`;
  1. ########################################################################
  2. typo3.sys_log
  3. ########################################################################
  1. Key recuidIdx ends with a prefix of the clustered index
  2. Key definitions:
  3. KEY `recuidIdx` (`recuid`,`uid`),
  4. PRIMARY KEY (`uid`),
  5. Column types:
  6. `recuid` int(11) unsigned not null default '0'
  7. `uid` int(11) unsigned not null auto_increment
  8. To shorten this duplicate clustered index, execute:
    ALTER TABLE `typo3`.`sys_log` DROP INDEX `recuidIdx`, ADD INDEX `recuidIdx` (`recuid`);

In order to save some disc space and make the world a little bit better, please remove this five duplicate database indexes.
All definition can be found in typo3/sysext/core/ext_tables.sql


Files

Actions

Also available in: Atom PDF