WordPress.org

Ready to get started?Download WordPress

Forums

Query Call (9 posts)

  1. Stuart
    Member
    Posted 10 years ago #

    Can someone tell me exactly what that "num_queries" call is contained in the "WordPress" credit paragraph at the bottom of the index.php page please?

  2. Mark (podz)
    Support Maven
    Posted 10 years ago #

    It's how long the program took to query the database to build the page.
    I think :)

  3. Stuart
    Member
    Posted 10 years ago #

    No. That's the "time" call. This one returns the number of queries and I'm wondering exactly what's meant by queries.

  4. skippy
    Member
    Posted 10 years ago #

    The number of database queries executed to fetch information from the database.

  5. Stuart
    Member
    Posted 10 years ago #

    Oh right. Thanks skippy. Just wondering if it was something I could use elsewhere.

  6. miahz
    Member
    Posted 10 years ago #

    is there a good or recommended number of queries per page to shoot for? i'm sure too many too often would probably be hard on the server, but how much is that?
    i ask because i added prev/next post links before and after posts on single post pages like on Photo Matt's and many others' sites. (i grabbed the code from Matt's index.php page in the wiki, and it uses the previous_post and next_post tags.) i noticed that added 4 more queries for each set, for a total of 8 more, going from 19 to 27 on post pages. is that "safe" - nothing to worry about? and my template is still pretty basic at this point, there'll probably be more features and functions in the future.

  7. Beel
    Member
    Posted 10 years ago #

    I had mine up to 70 and was going for 100, but unfortunately it fell to 60. I'll have to snag a few more "useless" hacks/plugins, I guess ;-)

  8. davidchait
    Member
    Posted 10 years ago #

    Depends on your website performance. Every hosting provider has things set up slightly differently. Mine has a different server running the MySQL instance than the apache/php box -- so each query has to go out over the internal network to get processed. At home, everything is on one machine, so it goes through a null-pipe to talk to the SQL service.
    My belief is that around two dozen is pretty good if you are running a few useful plugins. Beel is going to be my 'test optimization' case over time, to see if I can help him come down a bit more (though I >was< part of the problem at one point!). Caching is key, as is not doing queries you don't really have to, and requesting all the data you can rather than a secondary query later.
    Of course, there's the inevitable tradeoff of asking for too much data, which takes longer to process and send back on the wire, versus asking for minimal data and thus needing a second/followup query to fill in the blanks.
    At the end of the day, if your page loads fast enough for you, and your hosting provider isn't bitching about you taking a hit on their SQL server, you're okay with a few dozen certainly, more in certain circumstances (i.e., I have administrative scripts which run hundreds of queries on a given page...).
    -d
    CHAITGEAR

  9. miahz
    Member
    Posted 10 years ago #

    thanks for the info, davidchaitt. i'm not too worried about it, especially since my site has essentially no traffic, but it's good to know. i've also been eying the Staticize caching plugin, which would help lighten the load - if there were a load to lighten.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.