Archive

Posts Tagged ‘MySQL 5.1 relational database foreign key table partitioning’

MySQL 5.1 Foreign Keys and Table Partitioning

January 23rd, 2009

Suns MySQL

Sun's MySQL


Well I was reviewing the table partitioning feature in the now GA MySQL 5.1 and to my dismay you may neither have a foreign key in a partitioned table nor can you have a foreign key in another table that refers to a key in a partitioned table. How lame is that! Good lord! One of the essential features of a relational database is that it be RELATIONAL. So now we’re left out in the cold if we want MySQL to enforce referential integrity with it’s existing provisions and use table partitioning at the same time.

I have already ran a scenario in my head to work around this problem. It’s should be as simple as setting up triggers to enforce database relations that should be either added, removed, or denied based on the relationship. Definitely NOT the preferred way to do this but another way to accomplish the same, without handling it in the application logic, escapes me at the moment.

rdylina Uncategorized