码迷,mamicode.com
首页 > 其他好文 > 详细

主键设置,总的来说int>Guid/string

时间:2015-04-01 20:05:55      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:mysql   mssql   performance   string   int   

主键设置,总的来说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

主键设置,总的来说int>Guid/string

标签:mysql   mssql   performance   string   int   

原文地址:http://blog.csdn.net/yangzhenping/article/details/44810253

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!