• WordPress make too many unneeded queries in front page
    While doing some optimization to the front page of my site
    I have printed out all the queries that being made by wordpress…
    It printed out that he does all the posts printing preparation… without me wanting to print any mainblog post.
    anyone knows how do i disable that function?

    ohh and I also found out that
    members directory i think add every time the page reloads new row to the db of the rewrite rule

    INSERT INTO wp_1_options (option_name,option_value,autoload) VALUES (‘rewrite_rules’, ‘a:118:{s:42:\”members/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$\”;s:26:\”index.php?pagename=members\”;s:34:\”members/([^/]+)/([^/]+)/([^/]+)/?$\”;s:26:\”index.php?pagename=members\”;s:26:\”members/([^/]+)/([^/]+)/?$\”;s:26:\”index.php?pagename=members\”;s:18:\”members/([^/]+)/?$\”;s:26:\”index.php?pagename=members\”;s:12:\”robots\\.txt$\”;s:18:\”index.php?robots=1\”;s:14:\”.*wp-atom.php$\”;s:19:\”index.php?feed=atom\”;s:13:\”.*wp-rdf.php$\”;s:18:\”index.php?feed=rdf\”;s:13:\”.*wp-rss.php$\”;s:18:\”index.php?feed=rss\”;s:14:\”.*wp-rss2.php$\”;s:19:\”index.php?feed=rss2\”;s:14:\”.*wp-feed.php$\”;s:19:\”index.php?feed=feed\”;s:22:\”.*wp-commentsrss2.php$\”;s:34:\”index.php?feed=rss2&withcomments=1\”;s:16:\”.*wp-signup.php$\”;s:21:\”index.php?signup=true\”;s:18:\”.*wp-activate.php$\”;s:23:\”index.php?activate=true\”;s:29:\”members/attachment/([^/]+)/?$\”;s:32:\”index.php?attachment=$matches[1]\”;s:39:\”members/attachment/([^/]+)/trackback/?$\”;s:37:\”index.php?attachment=$matches[1]&tb=1\”;s:59:\”members/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:54:\”members/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:54:\”members/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\”;s:50:\”index.php?attachment=$matches[1]&cpage=$matches[2]\”;s:22:\”(members)/trackback/?$\”;s:35:\”index.php?pagename=$matches[1]&tb=1\”;s:42:\”(members)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:47:\”index.php?pagename=$matches[1]&feed=$matches[2]\”;s:37:\”(members)/(feed|rdf|rss|rss2|atom)/?$\”;s:47:\”index.php?pagename=$matches[1]&feed=$matches[2]\”;s:30:\”(members)/page/?([0-9]{1,})/?$\”;s:48:\”index.php?pagename=$matches[1]&paged=$matches[2]\”;s:37:\”(members)/comment-page-([0-9]{1,})/?$\”;s:48:\”index.php?pagename=$matches[1]&cpage=$matches[2]\”;s:22:\”(members)(/[0-9]+)?/?$\”;s:47:\”index.php?pagename=$matches[1]&page=$matches[2]\”;s:32:\”phone-page/attachment/([^/]+)/?$\”;s:32:\”index.php?attachment=$matches[1]\”;s:42:\”phone-page/attachment/([^/]+)/trackback/?$\”;s:37:\”index.php?attachment=$matches[1]&tb=1\”;s:62:\”phone-page/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:57:\”phone-page/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:57:\”phone-page/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\”;s:50:\”index.php?attachment=$matches[1]&cpage=$matches[2]\”;s:25:\”(phone-page)/trackback/?$\”;s:35:\”index.php?pagename=$matches[1]&tb=1\”;s:45:\”(phone-page)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:47:\”index.php?pagename=$matches[1]&feed=$matches[2]\”;s:40:\”(phone-page)/(feed|rdf|rss|rss2|atom)/?$\”;s:47:\”index.php?pagename=$matches[1]&feed=$matches[2]\”;s:33:\”(phone-page)/page/?([0-9]{1,})/?$\”;s:48:\”index.php?pagename=$matches[1]&paged=$matches[2]\”;s:40:\”(phone-page)/comment-page-([0-9]{1,})/?$\”;s:48:\”index.php?pagename=$matches[1]&cpage=$matches[2]\”;s:25:\”(phone-page)(/[0-9]+)?/?$\”;s:47:\”index.php?pagename=$matches[1]&page=$matches[2]\”;s:27:\”forum/attachment/([^/]+)/?$\”;s:32:\”index.php?attachment=$matches[1]\”;s:37:\”forum/attachment/([^/]+)/trackback/?$\”;s:37:\”index.php?attachment=$matches[1]&tb=1\”;s:57:\”forum/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:52:\”forum/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:52:\”forum/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\”;s:50:\”index.php?attachment=$matches[1]&cpage=$matches[2]\”;s:20:\”(forum)/trackback/?$\”;s:35:\”index.php?pagename=$matches[1]&tb=1\”;s:40:\”(forum)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:47:\”index.php?pagename=$matches[1]&feed=$matches[2]\”;s:35:\”(forum)/(feed|rdf|rss|rss2|atom)/?$\”;s:47:\”index.php?pagename=$matches[1]&feed=$matches[2]\”;s:28:\”(forum)/page/?([0-9]{1,})/?$\”;s:48:\”index.php?pagename=$matches[1]&paged=$matches[2]\”;s:35:\”(forum)/comment-page-([0-9]{1,})/?$\”;s:48:\”index.php?pagename=$matches[1]&cpage=$matches[2]\”;s:20:\”(forum)(/[0-9]+)?/?$\”;s:47:\”index.php?pagename=$matches[1]&page=$matches[2]\”;s:30:\”feedback/attachment/([^/]+)/?$\”;s:32:\”index.php?attachment=$matches[1]\”;s:40:\”feedback/attachment/([^/]+)/trackback/?$\”;s:37:\”index.php?attachment=$matches[1]&tb=1\”;s:60:\”feedback/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:55:\”feedback/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:55:\”feedback/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\”;s:50:\”index.php?attachment=$matches[1]&cpage=$matches[2]\”;s:23:\”(feedback)/trackback/?$\”;s:35:\”index.php?pagename=$matches[1]&tb=1\”;s:43:\”(feedback)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:47:\”index.php?pagename=$matches[1]&feed=$matches[2]\”;s:38:\”(feedback)/(feed|rdf|rss|rss2|atom)/?$\”;s:47:\”index.php?pagename=$matches[1]&feed=$matches[2]\”;s:31:\”(feedback)/page/?([0-9]{1,})/?$\”;s:48:\”index.php?pagename=$matches[1]&paged=$matches[2]\”;s:38:\”(feedback)/comment-page-([0-9]{1,})/?$\”;s:48:\”index.php?pagename=$matches[1]&cpage=$matches[2]\”;s:23:\”(feedback)(/[0-9]+)?/?$\”;s:47:\”index.php?pagename=$matches[1]&page=$matches[2]\”;s:27:\”about/attachment/([^/]+)/?$\”;s:32:\”index.php?attachment=$matches[1]\”;s:37:\”about/attachment/([^/]+)/trackback/?$\”;s:37:\”index.php?attachment=$matches[1]&tb=1\”;s:57:\”about/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:52:\”about/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:52:\”about/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\”;s:50:\”index.php?attachment=$matches[1]&cpage=$matches[2]\”;s:20:\”(about)/trackback/?$\”;s:35:\”index.php?pagename=$matches[1]&tb=1\”;s:40:\”(about)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:47:\”index.php?pagename=$matches[1]&feed=$matches[2]\”;s:35:\”(about)/(feed|rdf|rss|rss2|atom)/?$\”;s:47:\”index.php?pagename=$matches[1]&feed=$matches[2]\”;s:28:\”(about)/page/?([0-9]{1,})/?$\”;s:48:\”index.php?pagename=$matches[1]&paged=$matches[2]\”;s:35:\”(about)/comment-page-([0-9]{1,})/?$\”;s:48:\”index.php?pagename=$matches[1]&cpage=$matches[2]\”;s:20:\”(about)(/[0-9]+)?/?$\”;s:47:\”index.php?pagename=$matches[1]&page=$matches[2]\”;s:32:\”feed/(feed|rdf|rss|rss2|atom)/?$\”;s:27:\”index.php?&feed=$matches[1]\”;s:27:\”(feed|rdf|rss|rss2|atom)/?$\”;s:27:\”index.php?&feed=$matches[1]\”;s:20:\”page/?([0-9]{1,})/?$\”;s:28:\”index.php?&paged=$matches[1]\”;s:41:\”comments/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:42:\”index.php?&feed=$matches[1]&withcomments=1\”;s:36:\”comments/(feed|rdf|rss|rss2|atom)/?$\”;s:42:\”index.php?&feed=$matches[1]&withcomments=1\”;s:29:\”comments/page/?([0-9]{1,})/?$\”;s:28:\”index.php?&paged=$matches[1]\”;s:44:\”search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:40:\”index.php?s=$matches[1]&feed=$matches[2]\”;s:39:\”search/(.+)/(feed|rdf|rss|rss2|atom)/?$\”;s:40:\”index.php?s=$matches[1]&feed=$matches[2]\”;s:32:\”search/(.+)/page/?([0-9]{1,})/?$\”;s:41:\”index.php?s=$matches[1]&paged=$matches[2]\”;s:14:\”search/(.+)/?$\”;s:23:\”index.php?s=$matches[1]\”;s:47:\”category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:52:\”index.php?category_name=$matches[1]&feed=$matches[2]\”;s:42:\”category/(.+?)/(feed|rdf|rss|rss2|atom)/?$\”;s:52:\”index.php?category_name=$matches[1]&feed=$matches[2]\”;s:35:\”category/(.+?)/page/?([0-9]{1,})/?$\”;s:53:\”index.php?category_name=$matches[1]&paged=$matches[2]\”;s:17:\”category/(.+?)/?$\”;s:35:\”index.php?category_name=$matches[1]\”;s:42:\”tag/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:42:\”index.php?tag=$matches[1]&feed=$matches[2]\”;s:37:\”tag/(.+?)/(feed|rdf|rss|rss2|atom)/?$\”;s:42:\”index.php?tag=$matches[1]&feed=$matches[2]\”;s:30:\”tag/(.+?)/page/?([0-9]{1,})/?$\”;s:43:\”index.php?tag=$matches[1]&paged=$matches[2]\”;s:12:\”tag/(.+?)/?$\”;s:25:\”index.php?tag=$matches[1]\”;s:47:\”author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:50:\”index.php?author_name=$matches[1]&feed=$matches[2]\”;s:42:\”author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\”;s:50:\”index.php?author_name=$matches[1]&feed=$matches[2]\”;s:35:\”author/([^/]+)/page/?([0-9]{1,})/?$\”;s:51:\”index.php?author_name=$matches[1]&paged=$matches[2]\”;s:17:\”author/([^/]+)/?$\”;s:33:\”index.php?author_name=$matches[1]\”;s:69:\”([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:80:\”index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]\”;s:64:\”([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$\”;s:80:\”index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]\”;s:57:\”([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$\”;s:81:\”index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]\”;s:39:\”([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$\”;s:63:\”index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]\”;s:56:\”([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:64:\”index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]\”;s:51:\”([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$\”;s:64:\”index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]\”;s:44:\”([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$\”;s:65:\”index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]\”;s:26:\”([0-9]{4})/([0-9]{1,2})/?$\”;s:47:\”index.php?year=$matches[1]&monthnum=$matches[2]\”;s:43:\”([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:43:\”index.php?year=$matches[1]&feed=$matches[2]\”;s:38:\”([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$\”;s:43:\”index.php?year=$matches[1]&feed=$matches[2]\”;s:31:\”([0-9]{4})/page/?([0-9]{1,})/?$\”;s:44:\”index.php?year=$matches[1]&paged=$matches[2]\”;s:13:\”([0-9]{4})/?$\”;s:26:\”index.php?year=$matches[1]\”;s:27:\”[^/]+/attachment/([^/]+)/?$\”;s:32:\”index.php?attachment=$matches[1]\”;s:37:\”[^/]+/attachment/([^/]+)/trackback/?$\”;s:37:\”index.php?attachment=$matches[1]&tb=1\”;s:57:\”[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:52:\”[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:52:\”[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$\”;s:50:\”index.php?attachment=$matches[1]&cpage=$matches[2]\”;s:20:\”([^/]+)/trackback/?$\”;s:31:\”index.php?name=$matches[1]&tb=1\”;s:40:\”([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:43:\”index.php?name=$matches[1]&feed=$matches[2]\”;s:35:\”([^/]+)/(feed|rdf|rss|rss2|atom)/?$\”;s:43:\”index.php?name=$matches[1]&feed=$matches[2]\”;s:28:\”([^/]+)/page/?([0-9]{1,})/?$\”;s:44:\”index.php?name=$matches[1]&paged=$matches[2]\”;s:35:\”([^/]+)/comment-page-([0-9]{1,})/?$\”;s:44:\”index.php?name=$matches[1]&cpage=$matches[2]\”;s:20:\”([^/]+)(/[0-9]+)?/?$\”;s:43:\”index.php?name=$matches[1]&page=$matches[2]\”;s:16:\”[^/]+/([^/]+)/?$\”;s:32:\”index.php?attachment=$matches[1]\”;s:26:\”[^/]+/([^/]+)/trackback/?$\”;s:37:\”index.php?attachment=$matches[1]&tb=1\”;s:46:\”[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:41:\”[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$\”;s:49:\”index.php?attachment=$matches[1]&feed=$matches[2]\”;s:41:\”[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$\”;s:50:\”index.php?attachment=$matches[1]&cpage=$matches[2]\”;}’, ‘yes’) ON DUPLICATE KEY UPDATE option_name = VALUES(option_name),option_value= VALUES(option_value),autoload= VALUES(autoload`)

    is it the members directory plugin or its just the wordpress adds every reload the rewrite rules again and again and again?
    thats a bug or is it a design flow?
    why wordpress system needs to add the rewrite rules every time?

Viewing 10 replies - 1 through 10 (of 10 total)
  • It printed out that he does all the posts printing preparation… without me wanting to print any mainblog post.

    You are describing a paradox. If you tell it to print the $wp_query object, of course it prepares it and ships it to the browser. If you don’t tell it to print the $wp_query object, it won’t be there. If you have no loop on your index.php page calling for posts, none will appear. No further optimization possible until you actually call posts. Then maybe a caching plugin will help.

    is it the members directory plugin or its just the wordpress adds every reload the rewrite rules again and again and again?

    Disable the plugin and try again. But I think you are misreading what you are echoing to the browser. That said, disabling plugins and/or themes you suspect are the cause of a queries overload would be a good first step in troubleshooting.

    why wordpress system needs to add the rewrite rules every time?

    It would be a bit silly if rewrites only worked some of the time?!?

    I have printed out all the queries that being made by wordpress

    All is a big list. WordPress instantiates a variety of objects to speed up calculations/communications with the db. $wpdb and $wp_query are a couple of the big queries; but avoiding them altogether doesn’t make sense. Increase memory limit, adding a caching plugin, upgrading hardware etc etc.

    Aaaaaand you’re using BuddyPress. the rewrites you’re asking about are particular to that plugin, and they will be changing it in the future (I think).

    ask over in their forums.

    Thread Starter stuk88

    (@stuk88)

    I’m using wordpress in ms state…
    And no there isn’t any buddypress plugin in the system…

    The system is silly because the use of rewrite rules is miss implanted.
    the sql query that does INSERT OR UPDATE to the rewrite rules every page refresh is unneeded.

    if the rewrite rules are changed the INSERT or UPDATE queries should be executed only when the change is being made.
    so why does they are being executed every page refresh?

    moreover the queries of posts printing are made without any loop in the code!
    Im using the wordpress ms as i said before, and the home.php template file isnt containing any posts printing loop.
    So why the system does all that queries:

    [8] => Array
    (
    [0] => SELECT * FROM wp_1_posts WHERE ID = 135 LIMIT 1
    [1] => 0.000222206115723
    [2] => require, require_once, require_once, require_once, include_once, WP_Rewrite->flush_rules, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index, get_page_uri, get_page, get_post
    )

    [9] => Array
    (
    [0] => SELECT ID, post_name, post_parent FROM wp_1_posts WHERE post_type = ‘attachment’ AND post_parent = 135
    [1] => 0.000150918960571
    [2] => require, require_once, require_once, require_once, include_once, WP_Rewrite->flush_rules, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index
    )

    [10] => Array
    (
    [0] => SELECT * FROM wp_1_posts WHERE ID = 33 LIMIT 1
    [1] => 0.00022292137146
    [2] => require, require_once, require_once, require_once, include_once, WP_Rewrite->flush_rules, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index, get_page_uri, get_page, get_post
    )

    [11] => Array
    (
    [0] => SELECT ID, post_name, post_parent FROM wp_1_posts WHERE post_type = ‘attachment’ AND post_parent = 33
    [1] => 0.000182867050171
    [2] => require, require_once, require_once, require_once, include_once, WP_Rewrite->flush_rules, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index
    )

    [12] => Array
    (
    [0] => SELECT * FROM wp_1_posts WHERE ID = 30 LIMIT 1
    [1] => 0.000212907791138
    [2] => require, require_once, require_once, require_once, include_once, WP_Rewrite->flush_rules, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index, get_page_uri, get_page, get_post
    )

    [13] => Array
    (
    [0] => SELECT ID, post_name, post_parent FROM wp_1_posts WHERE post_type = ‘attachment’ AND post_parent = 30
    [1] => 0.000151872634888
    [2] => require, require_once, require_once, require_once, include_once, WP_Rewrite->flush_rules, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index
    )

    [14] => Array
    (
    [0] => SELECT * FROM wp_1_posts WHERE ID = 18 LIMIT 1
    [1] => 0.000221014022827
    [2] => require, require_once, require_once, require_once, include_once, WP_Rewrite->flush_rules, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index, get_page_uri, get_page, get_post
    )

    [15] => Array
    (
    [0] => SELECT ID, post_name, post_parent FROM wp_1_posts WHERE post_type = ‘attachment’ AND post_parent = 18
    [1] => 0.000150918960571
    [2] => require, require_once, require_once, require_once, include_once, WP_Rewrite->flush_rules, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index
    )

    [16] => Array
    (
    [0] => SELECT * FROM wp_1_posts WHERE ID = 2 LIMIT 1
    [1] => 0.000205039978027
    [2] => require, require_once, require_once, require_once, include_once, WP_Rewrite->flush_rules, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index, get_page_uri, get_page, get_post
    )

    [17] => Array
    (
    [0] => SELECT ID, post_name, post_parent FROM wp_1_posts WHERE post_type = ‘attachment’ AND post_parent = 2
    [1] => 0.000150918960571
    [2] => require, require_once, require_once, require_once, include_once, WP_Rewrite->flush_rules, WP_Rewrite->wp_rewrite_rules, WP_Rewrite->rewrite_rules, WP_Rewrite->page_rewrite_rules, WP_Rewrite->page_uri_index
    )

    I am not going to sound smart discussing the where and when for the code to generate a zillion rewrite_rules, especially by looking only at var dumps in a browser. That mod_rewrite does work and it works well is all I know.

    If you are curious, walkthrough the code that generates the $vars you see in your browser prints, not very many clues in the dumps themselves.

    If an empty home.php has you wondering why anything is going on behind the scenes at all, start walking through the code from the first index.php in the root.

    At any rate, if what you are after is a snappier quicker feel to your site load speeds, try an object cache plugin.

    Thread Starter stuk88

    (@stuk88)

    well its not needed actually…
    the third line of the query array containing the function trace that executed the query itself.

    it says that the function that calls that query is WP_REWRITE
    so its now depends on me to find what file or plugin calls the rewrite engine so many times…

    i have discovered that the members directory plugin have been the reason of 15 unneeded queries that auto shooted every time the page reloads … shame on wpmudev that developed so inefficient plugin code.

    trying to find out what other plugins may call the rewrite engine so many times…

    Ah, thought it was Buddypress as it uses that /members/ URL.

    If it’s a *premium* plugin, then you really should go to their forum and troubleshoot there.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    The rewrite rules are NOT normally generated every page refresh. If you’re having them generate then either a) You have a plugin doing something stupid, or b) your database is not allowing the insert to occur, so the rules get regenerated because they are missing.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    BTW, you’re using an inefficient permalink structure.

    More info: http://ottopress.com/2010/category-in-permalinks-considered-harmful/

    For reference for anyone reading the thread, BuddyPress does not do anything with the rewrite rules or use rewrite rules for the BP content areas.

    Thread Starter stuk88

    (@stuk88)

    yea i already posted in their forums…
    they said its must be a bug…

    but i say its stupid coding… because the WP_REWRITE->FLUSH is called without an if condition or action hook…
    its just there…
    very inefficient.

    thx for the info about the permalinks structure.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘WordPress make too many unneeded queries in front page’ is closed to new replies.