Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After further investigation, I have discovered several problems with this approach. </p> <ol> <li><p>It is impossible to range partition on a DATETIME value (which dtime in the example is). <a href="http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-functions.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-functions.html</a></p></li> <li><p>The table I was partitioning had a primary key on an auto increment id column, and you cannot partition on an index if there is a different primary key.</p> <p>ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function See also <a href="http://blog.mclaughlinsoftware.com/2011/05/09/mysqls-real-partition-key/" rel="nofollow">http://blog.mclaughlinsoftware.com/2011/05/09/mysqls-real-partition-key/</a> <a href="http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-partitioning-keys-unique-keys.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-partitioning-keys-unique-keys.html</a></p></li> <li><p>WEEK() is not allowed as a partitioning function. <a href="http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-functions.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-functions.html</a></p></li> </ol> <p>From what I now know, if you have a UNIQUE AUTO_INCREMENT id as the primary key, it is impossible to partition on anything except that value.</p> <p>My queries all use the dtime column in the WHERE conditions, so it seems that unless I can partition somehow on dtime still, there is no benefit to partitioning this table (from a performance perspective). </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload