Bug #92485

Missing index on fe_login felogin_forgotHash - long sql requests

Added by Tymoteusz Motylewski 8 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Should have
Category:
felogin
Target version:
-
Start date:
2020-10-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Due too missing index in the fe_login felogin_forgotHash column, on big databases > 100k feusers queries to forgot password takes a long time to process.

An index to fe_users should be added:

ALTER TABLE fe_users ADD INDEX felogin_forgot_hash (felogin_forgotHash);

Without the index on the big db the queries take several seconds:

UPDATE `fe_users` SET `password` = ?, `felogin_forgotHash` = ?, `tstamp` = ? WHERE `felogin_forgotHash` = ?
^^3895 ms

SELECT * FROM `fe_users` WHERE (`felogin_forgotHash` = ?) AND ((`fe_users`.`disable` = ?) AND (`fe_users`.`starttime` <= ?) AND ((`fe_users`.`endtime` = ?) OR (`fe_users`.`endtime` > ?))) LIMIT ?
^^2582 ms

SELECT COUNT FROM `fe_users` WHERE (`felogin_forgotHash` = ?) AND ((`fe_users`.`disable` = ?) AND (`fe_users`.`starttime` <= ?) AND ((`fe_users`.`endtime` = ?) OR (`fe_users`.`endtime` > ?)))
^^874 ms

#1

Updated by Tymoteusz Motylewski 8 months ago

  • Description updated (diff)
#2

Updated by Georg Ringer 8 months ago

  • Status changed from New to Accepted
#3

Updated by Gerrit Code Review 8 months ago

  • Status changed from Accepted 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/c/Packages/TYPO3.CMS/+/66055

#4

Updated by Gerrit Code Review 8 months ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66115

#5

Updated by Tymoteusz Motylewski 8 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#6

Updated by Benni Mack 6 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF