![]() ![]() SELECT user_id, meta_key, meta_value FROM wp_usermeta WHERE user_id IN (42) ORDER BY umeta_id ASC Require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/BT/search.php'), the_post, WP_Query->the_post, WP_Query->setup_postdata, get_userdata, get_user_by, WP_User::get_data_by #134 (0.5ms) Queries for each search results: SELECT * FROM wp_users WHERE ID = '42' WordPress 4.3.1, PHP 5.4.43, MySQL 5.5.42, PremiumPress Directory Theme ![]() ![]() Site with Debug Bar installed: ( real site) Looking in the search loop code (below), I see it calls get_post_meta twice, and if I remove those then two of the SELECT meta_key queries per post disappear, and performance improve accordingly.įrom Otto's excellent answer, I learned that post meta's are supposed to be cached, unless update_post_meta_cache=false, which I didn't see anywhere. I've used the excellent Debug Bar plugin, and found out that each search result causes 5 DB queries, of which 3 are SELECT meta_key (see below for complete query list). I want to know why my site's search results are slow. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |