The website I am currently developing is handled by a variety of classes that I have developed to ensure the best of my sites needs to run in tip-top shape.
The only thing I can think of right now is, how many questions(queries) should a user sending per page load?
This page does include the following: Announcement - 5PER PAGE USER LOGIN/VERIFICATION - EACH PAGE VIDEO BLOG - CHECKS IF IT'S ENABLED OR OFF
8 queries on average are sent at a maximum of 3KB's per page. Should开发者_如何学JAVA I be worried or encouraged to keep continuing? :)
It's not about how many questions
, it's about smart questions
. You could select all records in table A and then use this result to get a matching result from table B, you could also use a single query using a JOIN and get the answer you're looking for.
The query count is not that important, it's all about how these queries help you to get the right anwser and how the queries are executed by the database server. Use EXPLAIN to see how a query is executed and see if something could be optimized.
I know a site (a webshop) that performs quite well while executing a minimum of 400 queries per page and having over 2000 orders a day (let alone the page views).
Although I admit that is running on quite a heavy server and still could use some optimization.
But no, 8 queries is fine, and you could do with some more if you need to.
精彩评论