7/12/2008 ↓

How many Queries are too many? 35comments

Author: Mark Ghosh Category: Blogging, General, WordPress

Thanks for visiting! We would like to serve you better. Please subscribe to our RSS feed for daily updates. This blog posts regular Wordpress news, updates of themes, plugins, ideas, hacks, quick fixes and everything about blogging, especially about Wordpress. You can also receive updates from this blog via email if you want that method of notification.

I have been asked this question quite a few times and I never have a perfect answer. It is obviously an important question to ask but it can be answered in many different ways based on preferences, need for plugins, optimization techniques used and a variety of other factors.

Weblog Tools Collection uses a lot of plugins and is very query heavy but the in spite of that, the front page uses 59 queries to generate itself. I think the default (on a vanilla WordPress install on the default theme) is 27 or something of that nature. The larger the number of queries, the slower the page is going to load and the more load you are going to put on your MySql server. All of the above is true if you do not use inline or regenerative caching mechanisms. The caveat on this blog is that its plugins and its MySql server are highly optimized (via inline caching mechanisms) to reduce load.

Larger number of queries on a WordPress blog are probably caused by plugins that have been installed. Plugin authors can have non-optimized and useless queries that either take a long time to execute or need a large(r) number of queries to acheive a simple(r) result. I suspect that one could follow the 80-20 rule with 80% of the queries on your blog being generated by 20% of the plugins. If you can identify the top hitters and either optimize or replace them, you will have a happier blog and a happier MySql server.

It is also important to remember that the number of queries might not be the only straw that is breaking the camel’s back. SQL queries can be poorly constructed and can put a tremendous drain on resources. I remember a certain recent comments plugin that made queries which scanned entire tables before producing a result. If you are concerned about the speed of you blog or the number of queries, start disabling plugins. You might be pleasantly surprised to find that a few plugins might be causing most of your headaches. Once you identify the suspect plugins, you can then either find replacements that are more oprtimized or find other ways of obtaining the same result.

How many queries does your font page generate? If you find efficiencies by disabling plugins, please tell us about the results.

1/23/2007 ↓

DiggProof your Wordpress 1comment

DiggProof your Wordpress A close look at optimizing and tweaking your MySql database for Wordpress and other tips and plugins to make your Wordpress blog faster than it already is. Even though Wordpress is fast in its own right, this article is geared for high traffic blogs and especially those that run Wordpress on smaller Virtual Private Servers.

While we are on the subject of optimizations, the newly released Wordpress 2.1 Ella has introduced many code and query optimizations that should make Wordpress much faster than it already was. For example, one of the changes introduced to handle future posts gives the database the ability to cache more queries at the MySql level and should reduce load on the database server (however minuscule).

12/13/2005 ↓

  • Closed, Open Source Share Compatibility Problems

    Closed, Open Source Share Compatibility Problems: Interesting take on the compatibility problems brought onto Wordpress by the latest versions of Mysql running in “strict” mode as default. Especially poignant here because I see well greased programmers moving to the postgresql model because of a shift of ideologies of the mysql group. I should look into the added benefits that the strict model provides to the system. (2)

10/19/2005 ↓

  • MYdbPAL Free Download

    MYdbPAL Free Download: I am not sure of this program and you are on your own to figure out how this works but from my initial reaction, though the user interface is hideous, it can be a useful database education tool and provide good insight into existing database schemas. Thanks SlickDeals (0)

Friends

Translate

Translate to German Translate to Spanish Translate to French Translate to Italian Translate to Portuguese Translate to Japanese Translate to Korean Translate to Russian Translate to Chinese

Latest Videos

S2