Profile My Little Forum - some suggestions (General)

by danielb987, Monday, March 20, 2017, 14:03 (270 days ago) @ danielb987

Some suggestions to improve response time

includes/index.inc.php, line 187. Time 1 062 milliseconds!

This query has several left joins. Since we are only interested in the latest 40 entries in the table mlf2_entries, I suggest that you first do a sql query from mlf2_entries. Then you use a for loop in php to do the rest of the queries. In my database, mlf2_entries has 193 000 rows, mlf2_read_entries has 5 000 rows and mlf2_userdata has 2 000 rows.

Doing left join can be very expensive.

----------------------------

includes/main.inc.php, line 344. Time 517 milliseconds!

SELECT COUNT(*) FROM mlf2_entries WHERE spam = 1

The query only seems useful for admins and moderators. The query is always run, even if I'm not logged in. I suggest that it is only run for admins and moderators.

----------------------------

includes/main.inc.php, line 336. Time 581 milliseconds!
includes/main.inc.php, line 339. Time 528 milliseconds!

These are two sql queries that counts the rows in mlf2_entries. Each has it's own where-clause, but they only returns a single number, the count of rows.

From my point of view, I don't see why these must be exactly correct. The number of posts and the number of threads on the bottom of the page is fun statistics, but it is in no way important. Who cares if the number of entries are 320 000 or 350 000? From my point of view, the statistics like the number of entries and number of topics is something that can be updated once per day and doesn't need to be more accurate than that, at least not for a big forum

For a small forum, there may be a different thing. A web master of a forum with 1000 entries and 100 topics may want to have the number more accurate, but for big forums, I don't see the point of having to update it more than once a day.


Complete thread:

 RSS Feed of thread

powered by my little forum