Does mysql support vertical partitioning?

Mysql: Why only unique/primary keys must have all the columns used in partitioning expression?

  • As per mysql explaination "all columns used in the partitioning expression for a partitioned table must be part of every unique key that the table may have". Why only unique/primary keys, why not other keys too ?

  • Answer:

    I believe it's so that a new INSERT/UPDATE can check for duplicate key violations by accessing only one partition. This is not necessary for non-unique indexes.  Any value in a non-unique key can occur in more than one partition, and there's no conflict. Note also that in the MySQL source code, in file sql/sql_partition.cc, there's a function check_primary_key(), which has a comment: This function verifies that if there is a primary key that it contains all the fields of the partition function. This is a temporary limitation that will hopefully be removed after a while. So I would infer that there are other ideas about how to implement partitioning without requiring unique indexes be included in the partition function.  As in any project, there are more good ideas than engineer-hours, and work must be done by prioritizing the features of most demand.

Bill Karwin at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.