![]() |
bad coding
Code:
Page generated in 0.71573806 seconds (37.71% PHP - 62.29% MySQL) with 97 queries |
Mmm... let me guess... showthread? 2 queries for every post?
|
forumdisplay
heh |
thats more then bad coding. thats a crash waiting to happen. :-/
|
You should have seen the arcade addon for the 'statistiks' hack. Until someone rewrote it, it caused 850 queries on an average site. :o
That's been cut down to 17 now. Must have been badly coded. |
850 queries???
That must have been some loop... |
Quote:
|
Quote:
It only adds ONE query to showthread, and its only ran ONCE..... you big meanie! Bwahaha j/k |
how good coder avoid using too much queries ?
tips or tour somewhere ? |
well when using vb and queries always make sure there isnt a function that already does what your doing. try combine related queries through left joins but do not combine too many that will all together slow down the entire query. also always try to cache table from table to another so you dont have to query another table when you could have cached the data from the beginning, i.e. anything to do with counting entries could easily be cached instead of having to query a table and counting x rows.
|
Don't forget all the other types of JOIN's too. It's amazing how much time you can spend trying to find a solution to a problem of gathering data when the answer can be solved with SQL. It's such a powerful tool available to us, it's well worth learning in-depth :)
|
definitelly, learning SQL helps you on avoiding a lot of queries :)
|
holy balls, 850?!
And I thought 20 was alot ;( |
All times are GMT. The time now is 12:03 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|