开发者

Binary vs Integer - as primary key?

I was wondering if there are any obvious pros and cons one should be aware about, while choosing to use a Binary type as a primary key, while being RA开发者_运维问答NDOMIZED.

Which means, new inserts will have random 4 bytes as their PK - versus having a sequence of type Integer?

I'm using MySQL/MyISAM.

Thanks, Doori Bar


If the primary key isn't sequential then insert performance for a clustered index will not be very good. It has to rearrange the index for almost every insert.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜