Forum

Thread tagged as: Question, Problem

perch debug showing time and highlights some queries

Below is the debug log,


Time Δ Debug Message 0.0717 0 [42] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM content_pages p LEFT JOIN content_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC, p.pagePath ASC 0.0729 0.0012 Matched route: celebrities/[slug:postslug] 0.0731 0.0002 Using master page: /templates/pages/celebrities.php 0.0731 0 Page arguments: Array ( [0] => /celebrities/sadie-robertson [postslug] => sadie-robertson [1] => sadie-robertson ) 0.0792 0.0061 [1] SELECT * FROM content_pages WHERE pagePath='/celebrities' LIMIT 1 0.0874 0.0082 [1] SELECT * FROM content_shop_cart WHERE cartID=1161 0.0879 0.0005 [1] SELECT * FROM content_shop_cart WHERE cartID=1161 0.0896 0.0017 Using template: /templates/pages/attributes/default.html 0.0898 0.0002 Using sub-template: /templates/pages/attributes/seo.html 0.0917 0.0019 Using template: /templates/pages/attributes/seo.html 0.0938 0.0021 [4] SELECT regionKey, regionHTML FROM content_content_regions WHERE regionPage='/celebrities' OR regionPage='*' ORDER BY regionPage DESC 0.0951 0.0013 [16] SELECT * FROM content_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC 0.096 0.0009 [1] SELECT pageTreePosition FROM content_pages WHERE pagePath='/celebrities' LIMIT 1 0.0963 0.0004 [1] SELECT pageID FROM content_pages WHERE pageTreePosition IN ('000-004', '000') ORDER BY pageTreePosition DESC 0.0971 0.0008 Using template: /templates/navigation/level1.html 0.0974 0.0002 [1] Using template: /templates/navigation/level2.html 0.0988 0.0015 [6] Using template: /templates/navigation/level2.html 0.1073 0.0085 [1] SELECT pageTreePosition FROM content_pages WHERE pagePath='/celebrities' OR pageSortPath='/celebrities' LIMIT 1 0.1078 0.0005 [1] SELECT * FROM content_pages WHERE pageNew=0 AND pageTreePosition IN ('000-004', '000') ORDER BY pageTreePosition 0.1089 0.001 [1] Using template: /templates/navigation/breadcrumbs.html 0.1123 0.0034 [1] SELECT collectionID, collectionTemplate FROM content_collections WHERE collectionKey='Celebrities' 0.1131 0.0008 [1] SELECT * FROM ( SELECT idx.itemID, ci.collectionID, ci.itemJSON, idx2.indexValue as sortval FROM content_collection_index idx JOIN content_collection_items ci ON idx.itemID=ci.itemID AND idx.itemRev=ci.itemRev AND idx.collectionID=ci.collectionID JOIN content_collection_revisions cr ON idx.itemID=cr.itemID AND idx.itemRev=cr.itemRev AND idx.collectionID=ci.collectionID JOIN content_collection_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE (idx.collectionID=2) AND ((idx.indexKey='slug' AND idx.indexValue='sadie-robertson')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, itemJSON, sortval ORDER BY sortval ASC 0.1298 0.0168 [3] Using template: /templates/content/Collections/celebrities.html 0.3681 0.2383 [41] SELECT DISTINCT settingID, settingValue FROM content_settings WHERE userID=0 0.3718 0.0036 Using template: /templates/mailchimp/forms/subscribe.html 0.3766 0.0048 [2] select * from collections where active = 1 0.3771 0.0005 [1] SELECT groupID FROM content_navigation WHERE groupSlug='footer-about' LIMIT 1 0.3774 0.0002 [2] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM content_navigation_pages np, content_pages p WHERE p.pageID=np.pageID AND np.groupID=2 AND p.pageNew=0 ORDER BY np.pageTreePosition ASC 0.3777 0.0003 [0] SELECT np.pageTreePosition FROM content_pages p, content_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=2 AND p.pagePath='/celebrities' LIMIT 1 0.3787 0.001 Request time: 0.3787 0.3787 0 Process time: 0.3754

2 queries are highlighted, i guess because they are slow, how do i optimize it or make sure site remains fast.

0.1298  0.0168  [3] Using template: /templates/content/Collections/celebrities.html
0.3681  0.2383  [41] SELECT DISTINCT settingID, settingValue FROM content_settings WHERE userID=0
sawan ruparel

sawan ruparel 0 points

  • 5 years ago

btw, love the feature of showing time for individual function. That makes it very easy to find the problem... kudos to that

Drew McLellan

Drew McLellan 2638 points
Perch Support

These can be red herrings. The debug only gives the timed difference between logged items - if nothing is logged then it can show as slow when there might just be lots of unlogged items between.