当我在MySQL中使用UUID作为主键时如何影响性能 [英] how can affect performance when I use UUIDs as my primary keys in MySQL
问题描述
当我在MySQL中将UUID用作主键时,我想知道会对服务器性能产生多大程度的影响.
I would like to know how or how much can affect the performance of the server when I use UUID for my primary keys in MySQL.
推荐答案
我想您正在使用InnoDB(无论如何,您应该....)
I suppose you are using InnoDB (You should anyway....)
因此,请阅读高性能MySQL 2ed第117页中的以下章节:
So read the following chapter from High performance MySQL 2ed, p.117: http://books.google.com.hk/books?id=BL0NNoFPuAQC&lpg=PA117&ots=COPMBsvA7V&dq=uuid%20innodb%20clustered%20index%20high%20performance%20mysql&pg=PA117#v=onepage&q&f=false
通常,从性能的角度来看(由于聚集索引),UUID是一个较差的选择,并且他们有一个基准来证明这一点.
In general, UUID is a poor choice from the performance standpoint (due to clustered index) and they have a benchmark to prove this.
这篇关于当我在MySQL中使用UUID作为主键时如何影响性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!