hkothari Posted September 9, 2009 Share Posted September 9, 2009 For one page, how many queries should be executed before it's considered too many. Also, how many queries open at once would be considered too many? Sorry if this is general, but I'm just trying to get an idea. Quote Link to comment https://forums.phpfreaks.com/topic/173727-how-many-queries-are-too-many/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 9, 2009 Share Posted September 9, 2009 It depends entirely on what the queries are and how they are being used on a page. It is not possible to give a general answer that will fit each situation. It takes knowing the specifics for any page. Just viewing your post on this forum - "Page created in 0.033 seconds with 21 queries." Quote Link to comment https://forums.phpfreaks.com/topic/173727-how-many-queries-are-too-many/#findComment-915763 Share on other sites More sharing options...
hkothari Posted September 10, 2009 Author Share Posted September 10, 2009 Oh, I never noticed that at the bottom, that kind of gives me an idea, mine would be around 20 or so queries, I was just trying to make sure that that wasn't an outrageous number. Than you very much. Quote Link to comment https://forums.phpfreaks.com/topic/173727-how-many-queries-are-too-many/#findComment-915768 Share on other sites More sharing options...
artacus Posted September 10, 2009 Share Posted September 10, 2009 Just be sure you need all of the queries. I've refactored newbie code where a page was doing 200+ queries and I replaced it with 4. That's a symptom of not knowing how to do proper joins in the db and instead using php to walk a result set and issue create another query. Quote Link to comment https://forums.phpfreaks.com/topic/173727-how-many-queries-are-too-many/#findComment-915789 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.