title: MySQL optimization: Perform Maths operation inside or outside of a query?
body: <p>I have a strong feeling that all mathematical operations unnecessary to the query itself ought to be preformed outside of the query. For example:</p>
  
  <pre><code>$result = mysql_query(SELECT a, a*b/c as score FROM table)
  while ($row = mysql_fetch_assoc($result))
  {
      echo $row['a'].' score: '.$row['score'].&lt;br&gt;;
  }
  </code></pre>
  
  <p>vs:</p>
  
  <pre><code>$result = mysql_query(SELECT a, b, c FROM table)
  while ($row = mysql_fetch_assoc($result))
  {
      echo $row['a'].' score: '.$row['a']*$row['b']/$row['c'].&lt;br&gt;;
  }
  </code></pre>
  
  <p>the second option would usually be better, especially with complex table joins &amp; such. This is my suspicion, I only lack confirmation . . .</p>