in2code-de / luxletter

Newsletter system for TYPO3
https://www.in2code.de/agentur/typo3-extensions/luxletter/
24 stars 25 forks source link

DB table sys_refindex gets upsized with entries from tx_luxletter_domain_model_* #130

Open rr-it opened 2 years ago

rr-it commented 2 years ago

There are lots of entries generated in the table sys_refindex and thereby sys_refindex becomes huge (> 1GB)

Maybe this might only be the case if you run:

vendor/bin/typo3cms referenceindex:update

See count:

SELECT `tablename`, COUNT(hash) as count FROM `sys_refindex` GROUP BY `tablename` ORDER BY count DESC 
tablename count
tx_luxletter_domain_model_link ~2900000
tx_luxletter_domain_model_log 302768
tx_luxletter_domain_model_queue 153330
sys_file 21512
sys_file_metadata 16349
tx_news_domain_model_news 14954
sys_file_reference 12956
tt_content 12710
sys_category 9187

Potential fix

Disable the reference index for records of the table tx_luxletter_domain_model_link (and maybe also for tx_luxletter_domain_model_log and tx_luxletter_domain_model_queue) via PSR-14 event TYPO3\CMS\Core\DataHandling\Event\IsTableExcludedFromReferenceIndexEvent.

https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/Events/Events/Core/DataHandling/IsTableExcludedFromReferenceIndexEvent.html

Then manually clean up old records:

DELETE FROM `sys_refindex` WHERE `tablename` LIKE 'tx_luxletter_domain_model_link';
OPTIMIZE TABLE `sys_refindex`;
einpraegsam commented 2 years ago

Thx, we are open for a pull request if you're interested.