title: Mysql - HASH PARITION vs RANGE PARTITION on a DATETIME column?
body: <p>Can someone tell me pros and cons of HASH PARITION vs RANGE PARTITION on a DATETIME column?
  Let consider we have POS table with 20 milion records and would want to create partitions based on transaction date's year like </p>
  
  <pre><code>PARTITION BY HASH(YEAR(TRANSACTION_DATE)) PARTITIONS 4;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>PARTITION BY RANGE(YEAR(TRANSACTION_DATE)) (
      PARTITION p0 VALUES LESS THAN (2010),
      PARTITION p1 VALUES LESS THAN (2012),
      PARTITION p2 VALUES LESS THAN (2013),
      PARTITION p4 VALUES LESS THAN MAXVALUE
  );
  </code></pre>
  
  <p>to improve performance of queries with TRANSACTION_DATE BETWEEN '2013-03-01' AND '2013-09-29'</p>
  
  <p>Which one better over the other? and why?</p>