Profile My Little Forum - some suggestions (General)
I think, the
spam
-column (and theuser_id
) should be an indexed column. Can you add this index to your database and run the analysis again?ALTER TABLE `mlf2_entries` ADD INDEX(`spam`); ALTER TABLE `mlf2_entries` ADD INDEX(`user_id`);
-
That was a huge improvement of two of the queries!
-
includes/main.inc.php, line 344:
SELECT COUNT(*) FROM mlf2_entries WHERE spam = 1
This query went from 500 millisecond to 0,5 milliseconds!
----
includes/main.inc.php, line 336:
SELECT COUNT(*) FROM mlf2_entries WHERE pid = 0 AND spam = 0
This query went from 600 milliseconds to 150 milliseconds!
----
Before the improvement, the top five queries took about 3,2 seconds in total. After the improvement, the top five queries took about 2,2 seconds in total.
Best regards,
Daniel