Welcome Guest, Not a member yet? Register   Sign In
Number of queries per page, what is considered the limit?
#1

[eluser]codex[/eluser]
I know, the less queries you have the better, but how many is considered 'a lot'? 50? 100?

Just curious.
#2

[eluser]Colin Williams[/eluser]
I personally start biting my nails at like 15 Smile But I don't know the actual answer. I mean, you could have one ridiculously large query and that would be bad. Tools like Drupal have 100+ out of the box. I'd be interested to hear from more experienced developers as well.
#3

[eluser]Glen Swinfield[/eluser]
You need to use as many as you need to use. It is just important to make sure that you are not running the same query twice where it is not necessary, and your sever etc is tuned to handle it.

If you limit yourself to a specific number without any wider consideration, you are effectively limiting what it is possible to build.
#4

[eluser]Bramme[/eluser]
[quote author="Glen Swinfield" date="1218898308"]It is just important to make sure that you are not running the same query twice where it is not necessary.[/quote]

Yeah, that's pretty important. I developped a site a while back, when I turned on the profiler, I suddenly saw I was doing some identical queries two or three times per page. Some caching and some smarter coding fixed that problem quickly, halving the amount of queries I had on my pages...
#5

[eluser]Derek Jones[/eluser]
The number of queries is a poor indicator of database usage optimization since all queries are not created equal. You could write one bad SELECT query that took the same time and more memory to retrieve than 1000 indexed COUNT queries.




Theme © iAndrew 2016 - Forum software by © MyBB