Big slow sql queries – widgets
Quote from zpasji on December 4, 2020, 6:35 pmHello,
I am using Query Monitor plugin and my forum is quite big and if I use Widgets Last Post / Topics I get heavy sql query message. The request is large, but it is impossible to write any better. Would there be an option to add, for example, additional fields to the wp_forum_posts table – e.g. last_post_in_topic (0/1) and in the wp_forum_topics table – count_posts_in_topic, the database would take a little more – slightly and maybe the queries could be created with a less burdensome server.
Hello,
I am using Query Monitor plugin and my forum is quite big and if I use Widgets Last Post / Topics I get heavy sql query message. The request is large, but it is impossible to write any better. Would there be an option to add, for example, additional fields to the wp_forum_posts table – e.g. last_post_in_topic (0/1) and in the wp_forum_topics table – count_posts_in_topic, the database would take a little more – slightly and maybe the queries could be created with a less burdensome server.
Quote from Asgaros on February 14, 2021, 11:19 amHello @zpasji
Thanks for your suggestion. I will check if I can do that. Why this seems an easy change, I see a lot of potential issues in this fields which could introduce new bugs because updating that data requires a lot of new logic (when moving topics, deleting posts, etc.).
Hello @zpasji
Thanks for your suggestion. I will check if I can do that. Why this seems an easy change, I see a lot of potential issues in this fields which could introduce new bugs because updating that data requires a lot of new logic (when moving topics, deleting posts, etc.).

