{"id":1839561,"date":"2011-01-01T15:35:18","date_gmt":"2011-01-01T15:35:18","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/reducing-database-queries\/"},"modified":"2016-08-19T21:55:39","modified_gmt":"2016-08-19T21:55:39","slug":"reducing-database-queries","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/reducing-database-queries\/","title":{"rendered":"Reducing database queries"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I have a custom post type (&#8216;faculty_profile) and a custom taxonomy (&#8216;departments&#8217;). On a page that lists all of the faculty profiles, it groups them by department. That page generates approximately 600-700 database queries. Given the large number of queries, I am pretty sure there are ways I can make the page more efficient. Do you have any ideas?<\/p>\n<p>My code:<\/p>\n<p><em>[Code moderated as per the <a href=\"https:\/\/codex.wordpress.org\/Forum_Welcome\">Forum Rules<\/a>. Please use the <a href=\"http:\/\/wordpress.pastebin.com\">pastebin<\/a>]<\/em><\/p>\n<p>What am I doing wrong?<\/p>\n<p>Thanks.<\/p>\n","protected":false},"template":"","class_list":["post-1839561","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1839561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1839561\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1839561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}