Bravo List
Register
Go Back   > Bravo List > P2P > Forum > Community Cafe
Reply
Thread Tools
  #1  
Old 17th October 2008, 10:16
djlee's Avatar
djlee djlee is offline
Senior Member
 
Join Date: Mar 2008
Posts: 183
Default sql optimisation thread
Ok so i figured the best way to improve my coding skills is to help others. Some of you may have noticed on your sites that you run quite a lof of queries from a default source install. This is generally because most sources you come across have not been optimised.

The most common cause of having too many queries is doing a single query then using a loop to gain extra information for each result record. So if your first query returns 150 records and you then loop to get extra data for each record you end up running an extra 150 queries plus the initial one meaning 151 queries are run. beleive it or not in most cases this can be cut down to one single query. you do the math and figure out how much your page would load after changing this.

Im not marketing myself as a PHP guru or as some sort of optimisation wizard. i know my fair bit of PHP as do most people here. If i cant figure out how to optimise something then thats that. I can only help as far as my knowledge allows me.

Anyway feel free to post snippets of code where you think sql queries and such could be saved. However i do warn you DO NOT post entire scripts and ask me to optimise it. I simply wont do it. Im here to help .. not do it all for you.


-----------

if people actually need such help i might also start a thread on xss/sql injection protection however the same rules will apply to that thread too. I wont do entire scripts for you and i can only help as much as my knowledge allows me too

-----------

Have fun
Reply With Quote
Reply

Tags
optimisation , sql , thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 17:38. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.