Skip to main content
IBM  
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : Web Architecture : Education - Tutorials
Writing efficient PHP
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
4. Optimizing database queries
  


Streamlining SELECT statements page 2 of 8


Review any embedded SELECT statements to identify any unused fields. That is, identify fields that are retrieved from the database but whose values are never used in the code following the query. This situation often results from code that has passed through the hands of several developers, or that has undergone several iterations of changes.

By eliminating unused fields from SELECT statements, you reduce the complexity of the query and reduce the amount of data sent over the network (or at least between the database server and the PHP script). The net affect of making such changes is a reduced database read time.


Main menuSection menuFeedbackPreviousNext
Privacy Legal Contact