Jump to content

how many queries are too many per page?


chronister

Recommended Posts

I completed the php calendar found here at phpfreaks
[url=http://www.phpfreaks.com/tutorials/83/0.php] http://www.phpfreaks.com/tutorials/83/0.php[/url]

After some modifications I turned it into an event calendar which stores in a mysql database. After much thinking I finally wrapped my head around how to find repeating events by using a start_date, end_date, and repeating interval.

I completed it, it works great, and then I got curious as to how many queries that calendar was pushing on each page load. I was shocked to see an average of 150 queries per page load!! I am running like 5 queries per day the calendar generates. So 31 days gives 155 queries.

Is this too many queries to have per page? I would like to reduce this, I will post my code if someone wants to help me tackle eliminating some of those queries.

Thanks,
Nate
Link to comment
https://forums.phpfreaks.com/topic/35109-how-many-queries-are-too-many-per-page/
Share on other sites

150 queries per page load! I think you need to optimize your database relationships and also do some real code changes. No page should ever have that many queries in a real time dynamic application. I have a banking application, (credit card, charge transfer agent) that has over 3 million process requests a day, and it runs 5 really complex queries and 4 other normal/simple queries, which to me is still to much. I also I have a forum running that is always very busy, (500+) user online all the time and it only uses 11 queries for the most intense operation, but most operations only use 7 to 9 queries per page.

printf

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.