title: How to store recent usage frequency in MySQL
body: <p>I'm working on the <code>Product Catalog</code> module of an <code>Invoicing</code> application.</p>
  
  <p>When the user creates a new invoice the <code>product name</code> field should be an autocomplete field which shows the most recently used products from the product catalog.</p>
  
  <p>How can I store this "usage recency/frequency" in the database?</p>
  
  <p>I'm thinking about adding a new field <code>recency</code> which would be increased by <code>1</code> every time the product was used, and decreased by <code>1/(count of all products)</code>, when an other product is used. Then use this <code>recency</code> field for ordering, but it doesn't seem to me the best solution. </p>
  
  <p>Can you help me what is the best practice for this kind of problem?</p>