chronister Posted January 21, 2007 Share Posted January 21, 2007 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 More sharing options...
printf Posted January 21, 2007 Share Posted January 21, 2007 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 Link to comment https://forums.phpfreaks.com/topic/35109-how-many-queries-are-too-many-per-page/#findComment-165812 Share on other sites More sharing options...
bibby Posted January 21, 2007 Share Posted January 21, 2007 I agree that 150 is too many. Anything that you anticipate reusing could be stored in arrays. Link to comment https://forums.phpfreaks.com/topic/35109-how-many-queries-are-too-many-per-page/#findComment-165855 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.