Are composite primary keys okay in a clustered environment?

Comments

2 comments

  • Avatar
    Johan

    Hi,

     

    yes it is okay, but your example will fail with:

    ERROR 1170 (42000): BLOB/TEXT column 'plugin' used in key specification without a key length

    You must index a part of the blob/text, like this look for 512 below, which will use the first 512B of the blob/text:

     create table history (      plugin     text,      runtime   int,      errors     int,      primary key (plugin(512), runtime)  );

    BR
    johan

     

     

     

     

    0
    Comment actions Permalink
  • Avatar
    Tom Barron

    Thanks, Johan! You answered quickly and saved me from some grief I would not have expected. Very helpful.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk