Set the primary key. In general, int & gt; Guid/string, guidstring

Source: Internet
Author: User

Set the primary key. In general, int> Guid/string, guidstring
Set the primary key. In general, int> Guid/string

 

Generally, setting int as the primary key is more efficient.


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

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.