WordPress.org

Ready to get started?Download WordPress

Forums

wp_nav_menu and db queries (4 posts)

  1. kongkang
    Member
    Posted 4 years ago #

    May I know how many db queries will do on wp_nav_menu

    Here an example my theme structure : image

    When I put

    <?php printf(__('%d queries. %s seconds.'), get_num_queries(), timer_stop(0, 3)); ?>

    looks like each wp_nav_menu will be 5 queries. So here I have 4 menus so the total is 20 queries

    This is normal?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 4 years ago #

    I haven't done the math or checked everything, but that seems pretty close to right to me.

    A normal page generation tends to run between 30 and 80 queries.

  3. kongkang
    Member
    Posted 4 years ago #

    A normal page generation tends to run between 30 and 80 queries.

    Now my theme on main page run 68 queries. 0.786 seconds. So this is a normal range?

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 4 years ago #

    A tad high, but pretty normal if you're using some heavy plugins.

Topic Closed

This topic has been closed to new replies.

About this Topic