主键设置,总的来说int>Guid/string
一般设置int为主键可以有更高的效率
mysql:
http://venublog.com/2010/04/19/choosing-the-right-data-type-makes-a-big-difference/
http://venublog.com/2010/04/20/int-and-string-data-comparison-difference-in-performance-because-of-quotes/
http://www.karafilis.net/sql-indexing-part4/
mssql:
http://www.sql-server-performance.com/2007/datatypes/
http://bytes.com/topic/sql-server/answers/143943-int-versus-char-primay-key-performance
http://www.codeproject.com/Articles/22853/SQL-Server-Performance-Tips-and-Guidelines
https://www.simple-talk.com/sql/t-sql-programming/searching-for-strings-in-sql-server-databases-/
http://www.informit.com/articles/printerfriendly/25862
How to choose?
http://blog.codinghorror.com/primary-keys-ids-versus-guids/
http://databases.aspfaq.com/database/what-should-i-choose-for-my-primary-key.html
http://www.informit.com/articles/printerfriendly/25862
http://krow.livejournal.com/497839.html
others:
http://programmers.stackexchange.com/questions/189026/why-is-the-usage-of-string-keys-generally-considered-to-be-a-bad-idea
http://www.dbforums.com/showthread.php?1666783-int-vs-varchar-columns-performance
http://sqlinthewild.co.za/index.php/2011/02/15/are-int-joins-faster-than-string-joins-2/
http://www.codeproject.com/Articles/17512/DataRow-Indexing-Performance-Integer-vs-String