title: Partition by Key in MySQL
body: <p>I'm trying to apply partition on a table with million of rows. E.g I have the following attributes <code>(Id,Devicecode(varchar),Latitude ,Longitude , time/date)</code> and I want to apply partition on device code, I know that partition can only be applied to primary key in this case if Id is the <code>primary key</code> then <code>Device code</code> should also be the <code>primary key</code>. What I didn't get is the <code>foreign key</code> limitation in mysql documentation. Does it says that I can't apply partitioning if the attribute is a <code>foreign key</code>? what can be the other limitations? Also "Partitions 4" means I want to create 4 partitions right?</p>