Wednesday, August 8, 2012

Re: Why is composite primary key bad?

One possible exception might be HABTM tables, consisting of just the foreign keys to the related tables. MySQL only supports clustering on the primary key and using a composite primary key would give you a covered index, which in theory should perform a bit better. Though in practice, I have not found much difference and usually add an integer primary key column to those tables as well.

--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 

No comments: