Skip Navigation

[Resolved] What best way can you suggest to debug/troubleshoot query performance for a View

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

Problem:

What best way can you suggest to debug/troubleshoot query performance for a View? What can I look into or do to see why some of my Views are taking 15 seconds to run. Our Posts database is just over 3,700 posts so it shouldn't be data volume. But could be something I am doing. For most of my views, I use the Query Filter and then within the loop I have IF statements to filter out more records from the view. For some complex Queries that can't be done via the QUery Filter, I'm using the wpv_filter_query FILTER.

Solution:

You can enable Views Debug mode here:

Dashboard-> Toolset-> Settings-> Front-end Content

in section "Debug mode", enable option "Enable Views debug mode"

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#the-views-debug-tool

This support ticket is created 5 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/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Mukesh 5 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1243330

Thanks Luo.

Just one additional question. What best way can you suggest to debug/troubleshoot query performance for a View? What can I look into or do to see why some of my Views are taking 15 seconds to run. Our Posts database is just over 3,700 posts so it shouldn't be data volume. But could be something I am doing. For most of my views, I use the Query Filter and then within the loop I have IF statements to filter out more records from the view. For some complex Queries that can't be done via the QUery Filter, I'm using the wpv_filter_query FILTER.

Thanks,
Mukesh

#1243332

Hello,

You can enable Views Debug mode here:
Dashboard-> Toolset-> Settings-> Front-end Content
in section "Debug mode", enable option "Enable Views debug mode"

Remove your custom PHP codes, compare the performance, check if it is your custom PHP codes problem.

More help:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#the-views-debug-tool

Enabling Views debug will open a popup on every page showing a Views element.
This popup will show usefull information about the elements being displayed: time needed to render, memory used, shortcodes details...

#1244798

My issue is resolved now. Thank you!