title: MySQL Performance DATE_FORMAT() vs YEAR() AND MONTH()
body: <p>Which is better for performance when looking for timestamps in current month and year?</p>
  
  <pre><code>SELECT *
  FROM mytable
  WHERE YEAR(CURRENT_TIMESTAMP) = YEAR(mytable.timestamp)
    AND MONTH(CURRENT_TIMESTAMP) = MONTH(mytable.timestamp)
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>SELECT *
  FROM mytable
  WHERE DATE_FORMAT(CURRENT_TIMESTAMP,'%m-%Y') = DATE_FORMAT(mytable.timestamp,'%m-%Y')
  </code></pre>