The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 12 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
Had a question about some queries we are seeing the Types plugin call on the post.php edit screens.
1)
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
FROM wp_posts
WHERE 1=1
AND wp_posts.post_type = 'show'
AND (wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'future'
OR wp_posts.post_status = 'draft'
OR wp_posts.post_status = 'pending'
OR wp_posts.post_status = 'private')
ORDER BY wp_posts.post_date DESC
LIMIT 0, 1 /* in [/nas/content/live/jambase3/wp-content/plugins/types/application/models/helper/condition/type/fields_assigned.php:13] */
2) SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
FROM wp_posts
WHERE 1=1
AND wp_posts.post_type = 'show'
AND (wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'future'
OR wp_posts.post_status = 'draft'
OR wp_posts.post_status = 'pending'
OR wp_posts.post_status = 'private')
ORDER BY wp_posts.post_date DESC
LIMIT 0, 1 /* in [/nas/content/live/jambase3/wp-content/plugins/types/application/models/helper/condition/type/fields_assigned.php:13] */
3) SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
FROM wp_posts
WHERE 1=1
AND wp_posts.post_type = 'show'
AND ((wp_posts.post_status = 'publish'))
ORDER BY wp_posts.post_date DESC
LIMIT 0, 1 /* in [/nas/content/live/jambase3/wp-content/plugins/types/application/models/helper/placeholder.php:200] */
On our pages these queries are accounting for about 4 seconds of the page's 7 second load time [we have hundreds of thousands of posts in this custom post type].
We ran all three of these queries on the command line and each time it simply produced the most recent Post ID in that custom post type - which we are unclear why the plugin/post needs in the first place.
Any guidance on how these queries are used - and if there is anything we can do to suppress them would be greatly appreciated.
I'm not sure how much help I can be but can you tell me more about the custom post type.
If I create a custom post type with Types and do nothing else but create a sample post and then edit that post, using Query Monitor to see the queries run on that page I only see one query such as you describe above (which I think is the final one).
Do you have post relationships and/or custom fields set up on this post type, too?
Yes - our "shows" custom post type does have custom fields - and does have one parent post type "Venue" and 3 children post types "Performance" ; "Ticketing Link" ; and "Contest"
Just a quick note on this thread [I am going to mark it as resolved] - as I have moved it over to the Professional Support forums after upgrading our membership.
Thanks!
The forum ‘Types Community Support’ is closed to new topics and replies.