The SQL Query Massacre of January 19th, 2008

SQL queries for main page load: 116 → 21.

Enough said.

Still making that number smaller.

Update: Looks like I’m done, every query has its own use now. Here are the results, in comparison to WordPress. Chyrp has the Tags and Comments modules enabled.

Note: This isn’t meant to be a stab at WordPress or anything. I just used it as a baseline.

Chyrp    WordPress
Index 21 21
Archive 21 19
Tags/Category View    14 20
Page View 11 25
Total Load Time 0.135 0.523
01:11 PM | 10 Comments

Comments

  1. Wow! I wonder if you can get it lower than WP in the Index and Archive pages..

    Chad Ohman on
  2. @Chad: It’s a whole lot lower without the Tags and Comments modules. Because of the links in the yellow bars, for each post it’s two extra queries. You end up with 10 extra queries at 5 posts per page.

    Without those two enabled they’d be down to 11 queries. The same goes for every other page that shows posts.

    Alex on
  3. Oh wow. That’s absolutely incredible. This article deserves a Digg.

    Chad Ohman on
  4. Fantastic! But shouldn’t your title be “2008” ?

    pixeldotter on
  5. pixel: Woops.

    Alex on
  6. I’m curious, how did you get a query count for Wordpress? can you point to the documentation if one exists?

    anon on
  7. anon: It’s part of the default theme’s footer.php.

    Alex on
  8. Dudes. This isn’t a test haven. Use the demo. Irrelevant, useless comments will be deleted.

    Alex on
  9. Amazine site
    Thanks, webmaster.

    state water heater on
  10. Very amazing site
    Thanks, webmaster.

    state select hot water heaters on