Conversation
supportI am helping someone with a slow site, and I believe a query from this plugin is causing some of the slowness. The site is using login-lockdown version 2.13 and the query looks like: Query_time: 10.000596 Lock_time: 0.000001 Rows_sent: 1 Rows_examined: 2874703 SELECT COUNT(login_attempt_ID) FROM wp_login_fails WHERE login_attempt_date + INTERVAL 1 MINUTE > '2025-07-21 15:05:24' AND login_attempt_IP = '120.138.19.65'; The ‘login_attempt_date’ column is being modified with a ‘+ interval 1 minute’ so cannot benefit from an index, however ‘login_attempt_IP’ absolutely can. Adding an index like: mysql> alter table wp_login_fails add index login_attempt_IP (login_attempt_IP); Query OK, 2874909 rows affected (43.95 sec) Records: 2874909 Duplicates: 0 Warnings: 0 Drops the query from 2.8 million rows examined and 10 second runtime, to 85 rows examined and 0.07 seconds runtime. Can this index be applied to future versions of the plugin so everyone can benefit? This query seems to be spawned from login-lockdown/libs/functions.php, in static function countFails. I checked the settings to see if data was being retained too long, making the table unnecessarily large, however I couldn’t find a setting about data retention time. Is there a setting? Thanks! Justin
Definitely! Thanks for the detailed suggestion. We will add it in the next update 🙂 This reply was modified 10 months, 1 week ago by Alexandru Tapuleasa .
Definitely! Thanks for the detailed suggestion. We will add it in the next update 🙂 This reply was modified 10 months, 1 week ago by Alexandru Tapuleasa .