title: Speed of calculations in SQL statement
body: <p>I've got a database (MySQL) table with three fields :  id, score, and percent.</p>
  
  <p>Long story short, I need to do a calculation on each record that looks like this:</p>
  
  <p>(Score * 10) / (1 - percent) = Value</p>
  
  <p>And then I need to use that value both in my code and as the ORDER BY field.  Writing the SQL isn't my issue - I'm just worried about the efficiency of this statement.  Is doing that calculation in my SQL statement the most efficient use of resources, or would I be better off grabbing the data and then doing math via PHP?</p>
  
  <p>If SQL is the best way to do it, are there any tips I can keep in mind for keeping my SQL pulls as speedy as possible?</p>
  
  <p><strong>Update 1:</strong> Just to clear some things up, because it seems like many of the answers are assuming differently :  Both the Score and the Percent will be changing constantly.  Actually, just about every time a user interacts with the app, those fields will change (those fields are actually linked to a user, btw).</p>
  
  <p>As far as # of records, right now it's very small, but I would like to be scaling for a target set of about 2 million records (users).  At any given time I will only need 20ish records, but I need them to be the top 20 records sorted by this calculated value.</p>