Project

General

Profile

Actions

Bug #92485

closed

Missing index on fe_login felogin_forgotHash - long sql requests

Added by Tymoteusz Motylewski over 3 years ago. Updated over 3 years 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

Actions

Also available in: Atom PDF