title: how to partition a table by datetime column?
body: <p>I want to partition a mysql table by datetime column. One day a partition.The create table scripts is like this:</p>
  
  <pre><code>CREATE TABLE raw_log_2011_4 (
    id bigint(20) NOT NULL AUTO_INCREMENT,
    logid char(16) NOT NULL,
    tid char(16) NOT NULL,
    reporterip char(46) DEFAULT NULL,
    ftime datetime DEFAULT NULL,
    KEY id (id)
  ) ENGINE=InnoDB AUTO_INCREMENT=286802795 DEFAULT CHARSET=utf8
  PARTITION BY hash (day(ftime)) partitions 31;
  </code></pre>
  
  <p>But when I select data of some day.It could not locate the partition.The select statement is like this:</p>
  
  <pre><code>explain partitions select * from raw_log_2011_4 where day(ftime) = 30;
  </code></pre>
  
  <p>when i use another statement,it could locate the partition,but I coluld not select data of some day.</p>
  
  <pre><code>explain partitions select * from raw_log_2011_4 where ftime = '2011-03-30';
  </code></pre>
  
  <p>Is there anyone tell me How I could select data of some day and make use of partition.Thanks!</p>