Hi,
I´ve created four views on my home page to display a category tree for different custom post types. The loading time without any caching plugin lasts nearly 20 seconds. I´ve investigated the issue and found with query monitor a really long query, which comes from toolset:
[code]
SELECT n0w18p_posts.*
FROM n0w18p_posts
LEFT JOIN n0w18p_term_relationships
ON (n0w18p_posts.ID = n0w18p_term_relationships.object_id)
INNER JOIN n0w18p_postmeta
ON ( n0w18p_posts.ID = n0w18p_postmeta.post_id )
LEFT JOIN n0w18p_icl_translations t
ON n0w18p_posts.ID = t.element_id
AND t.element_type = CONCAT('post_', n0w18p_posts.post_type)
WHERE 1=1
AND n0w18p_posts.ID NOT IN (467)
AND ( n0w18p_term_relationships.term_taxonomy_id IN (2523) )
AND ( ( n0w18p_postmeta.meta_key = 'wpcf-g-level'
AND CAST(n0w18p_postmeta.meta_value AS SIGNED) = '1' ) )
AND n0w18p_posts.post_type = 'product-group-page'
AND ((n0w18p_posts.post_status = 'publish'
OR n0w18p_posts.post_status = 'private'))
AND ( ( ( t.language_code = 'en'
OR ( t.language_code = 'en'
AND n0w18p_posts.post_type IN ( 'post' )
AND ( ( (
SELECT COUNT(element_id)
FROM n0w18p_icl_translations
WHERE trid = t.trid
AND language_code = 'en' ) = 0 )
OR ( (
SELECT COUNT(element_id)
FROM n0w18p_icl_translations t2 JOIN n0w18p_posts p
ON p.id = t2.element_id
WHERE t2.trid = t.trid
AND t2.language_code = 'en'
AND p.post_status IN ( 'publish' ) ) = 0 ) ) ) )
AND n0w18p_posts.post_type IN ('post','page','attachment','avada_portfolio','avada_faq','product','specialist','product-group-page','product-image','product-link','suppliers' ) )
OR n0w18p_posts.post_type NOT IN ('post','page','attachment','avada_portfolio','avada_faq','product','specialist','product-group-page','product-image','product-link','suppliers' ) )
GROUP BY n0w18p_posts.ID
ORDER BY n0w18p_posts.post_date DESC
+ Toggle button
WP_Query->get_posts()
Plugin: wp-views 1 0.0372
2557 SELECT n0w18p_posts.*
FROM n0w18p_posts
LEFT JOIN n0w18p_term_relationships
ON (n0w18p_posts.ID = n0w18p_term_relationships.object_id)
INNER JOIN n0w18p_postmeta
ON ( n0w18p_posts.ID = n0w18p_postmeta.post_id )
LEFT JOIN n0w18p_icl_translations t
ON n0w18p_posts.ID = t.element_id
AND t.element_type = CONCAT('post_', n0w18p_posts.post_type)
WHERE 1=1
AND n0w18p_posts.ID NOT IN (467)
AND ( n0w18p_term_relationships.term_taxonomy_id IN (2523) )
AND ( ( n0w18p_postmeta.meta_key = 'wpcf-g-level'
AND CAST(n0w18p_postmeta.meta_value AS SIGNED) = '2' ) )
AND n0w18p_posts.post_type = 'product-group-page'
AND ((n0w18p_posts.post_status = 'publish'
OR n0w18p_posts.post_status = 'private'))
AND ( ( ( t.language_code = 'en'
OR ( t.language_code = 'en'
AND n0w18p_posts.post_type IN ( 'post' )
AND ( ( (
SELECT COUNT(element_id)
FROM n0w18p_icl_translations
WHERE trid = t.trid
AND language_code = 'en' ) = 0 )
OR ( (
SELECT COUNT(element_id)
FROM n0w18p_icl_translations t2 JOIN n0w18p_posts p
ON p.id = t2.element_id
WHERE t2.trid = t.trid
AND t2.language_code = 'en'
AND p.post_status IN ( 'publish' ) ) = 0 ) ) ) )
AND n0w18p_posts.post_type IN ('post','page','attachment','avada_portfolio','avada_faq','product','specialist','product-group-page','product-image','product-link','suppliers' ) )
OR n0w18p_posts.post_type NOT IN ('post','page','attachment','avada_portfolio','avada_faq','product','specialist','product-group-page','product-image','product-link','suppliers' ) )
GROUP BY n0w18p_posts.ID
ORDER BY n0w18p_posts.post_title ASC
[/code]
Can you please help me to understand, how I can improve the loading time of my home page without having to use any caching plugin. 90% of the whole loading time is the http call itself. Is there any index I can build?
In order to access my site you need to have http auth credentials - please send me private ticket.
Thanks and regards,