I was researching for a CMS to use and ran into a review on vBulletin 4.0; using about 200 queries on one page load.
I was then worried.
Further research brought me to other sites to see how much queries they are using and I found that some forum software such as Invision Power Board and PHPBB are using queries as low as 6 or 8.
Currently, my site uses about 25 to 40 queries.
Should I be worried?
Executive Summary. 200 SQL statements per webpage is excessive for client/server database engines like MySQL, PostgreSQL, or SQL Server.
Millions of rows is not a problem, this is what SQL databases are designed to handle, if you have a well designed schema and good indexes.
This issue occurs because SQL Server limits the number of identifiers and constants that can be contained in a single expression of a query. This limit is 65,535.
If your database service only allows you to make simple SQL queries, less than 20 queries would be fine for a small, common webpage, but if it's the webpage for your university or a decision taking support application, 60 may not be enough.
Don't be worried about number of queries.
Be worried about:
Clarification:
SQL being too complicated can come from either too many queries OR a few queries that are very complicated (lots of joins and sub queries, etc).
If you aim for something, aim for 3 reads and 1 writes per HTTP hit.
While these are arbitrary numbers (somehow, they are actually taken from the Advanced PHP Programming), they emphasize the ideas:
Also remember that not all reads are equal: the 3 reads should be highly optimized reads, not full table scans with 4-5 outer joins...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With