Skip Navigation

[Resolved] Slow Queries (above 1 sec)

This thread is resolved. Here is a description of the problem and solution.

Problem: Many-to-many relationship queries are slow.

Solution: Update to the latest versions of all Toolset plugins and minimize many-to-many relationships with intermediary posts.

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 11 replies, has 2 voices.

Last updated by Christian Cox 4 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1100596

Max
006.png
005.png
004.png
003.png
002.png
001.png

I am trying to:
show 1 child post by URL parameter

Link to a page where the issue can be seen:
hidden link

I expected to see:
normal page loading speed

Instead, I got:
loading one post takes 6 seconds (due to slow Queries)

#1100796

It looks like these three lines are the main problem:

<span class="fist"></span><span class="text-center rezult [types field='rezult' output='raw' item='@fights-fighters.intermediary'][/types]">[types field='rezult' item='@fights-fighters.intermediary'][/types]</span>
<div class="method-single">[types field='method' item='@fights-fighters.intermediary'][/types]</div>

Querying the intermediary post type in the loop is causing the slowness. Let me run some tests to see what I can do to help speed this up. I can see your database contains over 1.2 million posts and almost 900k relationship links in the relationship table, which is fairly large. Maybe there is a better way to structure this View to lower the number of nested queries. I'll let you know what I find out.

#1100803

Max

Thank you, Christian, that you find the time to solve this problem. Yes, you are right, the problem of performance in the nesting of views... I've been wondering for a week how to simplify the structure, but I have not come to anything. I hope with your help the problem will be solved 🙂

#1108855

Max

Christian, is there any news?

#1109011

Hi, there is nothing new to share at this time. My second tier team did an initial investigation and determined that more in-depth analysis is required, and I am waiting to receive the results of that analysis. I will let you know what we find out.

#1140622

Max

Hi! Is there any news? This problem slows down the development of the site ...

#1141348

Sorry no, there is nothing new to share at this time. As a temporary solution, you could try adding a caching plugin, turning off infinite scroll and turning off AJAX updates.

#1141429

Max
screen_backend.png

I turned off infinite scroll and turning off AJAX. This did not improve performance. I want to clarify that there is no such problem in the admin, page loads fine (see screenshot). Maybe this will help.

#1143233

Thank you for that information, I have passed it along to my 2nd tier investigation team.

#1842217

After quite some time, our developers have updated this internal ticket and informed me that relationship queries have changed significantly in recent updates. If you are still experiencing considerable delays after updating and performing relationship migrations, please update this ticket with your findings and we can investigate in more detail. Thank you!

#1842429

Max

Christian, good to hear from you.
Yes, I am aware of the changes in the Toolset.
Today I have come to the ideal setup for relationships and CPT.
I found that intermediate items are less efficient than CPTs.
So I replaced M2M relationship with two O2M.
I also changed the internal architecture of the project.
Therefore, this problem is no longer relevant.

#1842471

Okay thank you for following up. I will close here as no longer relevant.