Task #82671
closedRemove duplicate database indexes
100%
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:
- ########################################################################
- typo3.index_words
- ########################################################################
- Key metaphone ends with a prefix of the clustered index
- Key definitions:
- KEY `metaphone` (`metaphone`,`wid`)
- PRIMARY KEY (`wid`),
- Column types:
- `metaphone` int(11) not null default '0'
- `wid` int(11) not null default '0'
- To shorten this duplicate clustered index, execute:
ALTER TABLE `typo3`.`index_words` DROP INDEX `metaphone`, ADD INDEX `metaphone` (`metaphone`);
- Key baseword ends with a prefix of the clustered index
- Key definitions:
- KEY `baseword` (`baseword`,`wid`),
- PRIMARY KEY (`wid`),
- Column types:
- `baseword` varchar(60) not null default ''
- `wid` int(11) not null default '0'
- To shorten this duplicate clustered index, execute:
ALTER TABLE `typo3`.`index_words` DROP INDEX `baseword`, ADD INDEX `baseword` (`baseword`);
- ########################################################################
- typo3.sys_category
- ########################################################################
- parent is a left-prefix of category_list
- Key definitions:
- KEY `parent` (`pid`),
- KEY `category_list` (`pid`,`deleted`,`sys_language_uid`)
- Column types:
- `pid` int(11) not null default '0'
- `deleted` smallint(6) not null default '0'
- `sys_language_uid` int(11) not null default '0'
- To remove this duplicate index, execute:
ALTER TABLE `typo3`.`sys_category` DROP INDEX `parent`;
- ########################################################################
- typo3.sys_domain
- ########################################################################
- parent is a left-prefix of getDomainStartPage
- Key definitions:
- KEY `parent` (`pid`),
- KEY `getDomainStartPage` (`pid`,`hidden`,`domainName`)
- Column types:
- `pid` int(11) unsigned not null default '0'
- `hidden` smallint(5) unsigned not null default '0'
- `domainname` varchar(80) not null default ''
- To remove this duplicate index, execute:
ALTER TABLE `typo3`.`sys_domain` DROP INDEX `parent`;
- ########################################################################
- typo3.sys_log
- ########################################################################
- Key recuidIdx ends with a prefix of the clustered index
- Key definitions:
- KEY `recuidIdx` (`recuid`,`uid`),
- PRIMARY KEY (`uid`),
- Column types:
- `recuid` int(11) unsigned not null default '0'
- `uid` int(11) unsigned not null auto_increment
- 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
Updated by Alexander Grein about 7 years ago
The definition for indexed_search can be found in:
typo3/sysext/indexed_search/ext_tables.sql
The definition of sys_domain can be found in:
typo3/sysext/frontend/ext_tables.sql
Updated by Alexander Grein about 7 years ago
- File remove-double-index-from-sys_category-and-sys_log.patch remove-double-index-from-sys_category-and-sys_log.patch added
- File remove-double-index-from-index_words.patch remove-double-index-from-index_words.patch added
- File remove-double-index-from-sys_domain.patch remove-double-index-from-sys_domain.patch added
Patchfiles attached
Updated by Sybille Peters over 6 years ago
Thank you for your report.
Even though it has been some time, would you consider submitting a new patch to our Gerrit review server?
You can find a description of the TYPO3 contribution workflow here: https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/
Hint: If you get stuck anywhere, ask on Slack in the #typo3-cms-coredev channel. You can register in the TYPO3 slack workspace here: https://forger.typo3.com/slack
Also, if your issue is no longer reproducable, please let us know in the slack channel, so that this issue can be closed.
Thank you in advance!
Sybille
Updated by Gerrit Code Review over 6 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56856
Updated by Gerrit Code Review over 6 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56856
Updated by Gerrit Code Review over 6 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56911
Updated by Stefan Froemken over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset fe115c7583b4e8e7aa492e6a49d07eb25546eafb.