Note that there are some explanatory texts on larger screens.

plurals
  1. USAdamJonR
    primarykey
    data
    text
    plurals
    1. CO@Mahn, "...if I had 4 queries like the following in a script: SELECT * from users WHERE userID = 1, removing one of them would get me nothing." OK, I just tested this using my wordpress db on Rackspace Cloudsites (first with 4 SELECT * from wp_posts WHERE id = 1, then with 3, 2, 1.) Viewing the cachegrind, I see a 7% increase, 9% increase, 16% increase. And, I started PHP sessions and loaded my web framework (to increase PHP's work), and this occurred with really small, simple queries on a very small DB. In my opinion, these performance increases are not nothing.
      singulars
    2. CO@Mahn, cont... This depends on many factors. What type of persistence store is being used (MongoDB, MySQL, etc.) Where is the DB (same server or separate server.) Is the DB tuned for writes or reads? How many rows are in the DB? How many rows are required for the page request? How many joins are required? Etc... The point is that it there are many factors to consider. In a big DB that's on a separate server than the web server, I've seen (using PHP and XDebug) results where there was a 12% improvement by removing one query.
      singulars
    3. CO@Mahn, Well, I doubt either of us could find data to support our claims on 15 - 20 database calls being normal or abnormal per page request. I've never built an app that required more than 6 DB calls on a particular page (and most of the time I'd work really hard to avoid even that many, 2 requests, even on my most complex apps, is more likely.) Now, in terms of the percentage increase of 12% (or more), I'm not speaking hypothetically here, I've actually benchmarked this. I've had real-world apps show a 12% improvement by refactoring the code to remove 1 of 3 or 4 existing calls...
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload