Skip Navigation

[Resolved] Views query takes up to 90 seconds to load

This support ticket is created 4 years, 8 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by timd-5 4 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#1610627
Screenshot 2020-04-28 at 10.04.17.png
Screenshot 2020-04-28 at 10.03.19.png

Hi,

On the site hidden link it takes ages to load a page. We've looked into what is holding up the pages and it turns out all pages that contain a Views block have this issue.

This is the query that takes between 22 and 99 seconds to load:

---
SELECT mock_posts.* FROM mock_posts LEFT JOIN mock_icl_translations wpml_translations
ON mock_posts.ID = wpml_translations.element_id
AND wpml_translations.element_type = CONCAT(?, mock_posts.post_type) WHERE ?=? AND (
(
SELECT COUNT(?)
FROM mock_term_relationships
WHERE term_taxonomy_id IN (?)
AND object_id = mock_posts.ID
) = ?
) AND mock_posts.post_type = ? AND ((mock_posts.post_status = ?)) AND ( ( ( wpml_translations.language_code = ? OR ? ) AND mock_posts.post_type IN (?,?,?,?,?,?,?,?,? ) ) OR mock_posts.post_type NOT IN (?,?,?,?,?,?,?,?,? ) ) GROUP BY mock_posts.ID ORDER BY mock_posts.post_title DESC
---

Is this a known issue? And how can this be resolved?

Kind regards,
Tim de Jong

#1611821

Hi,

Thank you for contacting us and I'd be happy to assist.

I've checked the page that you've shared and it seems to load for me in 9.21 - 9.33 seconds.

Are you experiencing this in any particular browser or when logged-in as a specific user?

If yes, you're welcome to share more details and the temporary admin login details for that user and I'll be able to investigate this accordingly.

Note: Your next reply will be private and though no changes will be made on your website, please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1624301

Hi Tim,

Thank you for sharing these details.

During the tests, the homepage of the staging environment loads for me in 12.24s, on average. Considering the number of plugins running in the background and the amount of content involved for rendering, this loading time seems to be normal.

I couldn't perform query analysis on this staging environment using the "Query Monitor" plugin ( https://wordpress.org/plugins/query-monitor/ ), as it seems the server configuration doesn't allow it.
( it shows this message: No database queries were logged because the SAVEQUERIES constant is set to false. )

If you'll check your website's page(s) through speed/performance testing tools like Pingdom ( hidden link ), Google's page speed insights ( hidden link ) and GTmetrix ( hidden link ), you'll find the common issues are related to how the static content is delivered on the front-end.

Most of the points mentioned in those tools can be improved using a good cache and code minification plugin. You'll also find some useful tips around optimization from this guide:
hidden link

I hope these points will help and please let me know how it goes.

regards,
Waqar

#1625407

Indeed, updating Views did the trick. Thanks!