Task #96363
closedPerformance optimization for LiveSearch
0%
Description
Hello,
TYPO3 LiveSearch uses this query by default for string searches:
WHERE LOWER(column) LIKE "lower-cased-value"
In case of collations like utf8_general_ci (ci stands for case-insensitive) there is no need to lowercase ALL column values. Of cause a case-sensitive search makes sense for collations like utf8_general_cs, uft8_unicode_bin and where TCA ['config']['search']['case'] is true.
You can test performance yourself on MySQL with case-insensitive column collations:
SET profiling = 1; SELECT SQL_NO_CACHE uid, pid, header FROM tt_content WHERE bodytext LIKE "%HeLlO%"; SHOW profile; SELECT SQL_NO_CACHE uid, pid, header FROM tt_content WHERE LOWER(bodytext) LIKE "%hello%"; SHOW profile;
Last query is always slower than the first query.
I will provide a patch.
PS: IMO ['search']['case']-option has never been working.
Stefan
Updated by Gerrit Code Review almost 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72668
Updated by Gerrit Code Review almost 3 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72668
Updated by Gerrit Code Review over 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72668
Updated by Gerrit Code Review over 1 year ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72668
Updated by Stefan Froemken over 1 year ago
- Status changed from Under Review to Closed
The benefit is 0.003 seconds on a table with 60.000 records. That's not a real performance improvement.