Skip Navigation

[Resolved] Views & Performance – Which Approach Is Best Please?

This support ticket is created 7 years, 4 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by julieP 7 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#541441

I'm a bit fuzzy about the best approach to use from a site performance point of view when implementing Views.

I have a View which has 'post author' and a 'post status' filters. Within the Loop, I have 3 conditional statements which state:-

if post is pending, show 'X'
if post is draft, show 'Y'
if post is published, show 'Z'.

My question is this: is this single View the right or best way of displaying the required output or would it be better to create 3 separate Views instead which would remove the need for any conditional statements as the criteria would be set by the View's filters?

Many thanks for your advice.

#541817

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - if you create a separate view for each post status or for post author it will fire N number of query per view. So it depends upon the list you are going to display for each post status or author.

If you are aiming to display a lot of posts per status then I would suggest creating a view for each status as views also cache the results.

So - if you are not aiming to display thousands of entries, I suggest you keep only one view and add conditional statements.

We also offer guidelines how you can use views on large sites:
=> https://toolset.com/documentation/user-guides/front-page-filters/how-to-use-views-parametric-search-on-large-sites/

#541981

Thanks Minesh; that helps me decide what to do!