Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server 2005 General Discussion
»
Datatype performance
Datatype performance
Rate Topic
Display Mode
Topic Options
Author
Message
hi2u
hi2u
Posted Wednesday, December 05, 2012 3:17 PM
Grasshopper
Group: General Forum Members
Last Login: Friday, May 17, 2013 7:04 AM
Points: 16,
Visits: 731
Hello
This may be a stupid question but are there any performance difference between different data type.
For this query :
select * from Table where column = @column
is a bigint column gonna be faster than a binary(8) or a char(8) column ?
Is this the same for an insert with an unique key or in a table join ? is there a datatype that will perform better?
There is surely an article on this subject somewhere , but i wasnt able to find one.
Post #1393243
Koen Verbeeck
Koen Verbeeck
Posted Thursday, December 06, 2012 12:27 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Yesterday @ 9:06 AM
Points: 9,367,
Visits: 6,465
Usually integer columns are a bit faster than string columns.
So for a primary key it's a good idea to take an integer column, instead of a string column or a GUID.
How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
Member of
LinkedIn
. My blog at
LessThanDot
.
MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1393350
hi2u
hi2u
Posted Thursday, December 06, 2012 9:58 AM
Grasshopper
Group: General Forum Members
Last Login: Friday, May 17, 2013 7:04 AM
Points: 16,
Visits: 731
Thank you for the info
If string is the slowest, is there any difference between a integer and a binary field ?
Post #1393627
GilaMonster
GilaMonster
Posted Thursday, December 06, 2012 10:01 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 3:30 AM
Points: 37,675,
Visits: 29,928
Faster in this case does not mean noticably or measurably faster. Maybe a few microseconds for a simple comparison like that. Joins show more of an effect, but you still need to be doing huge joins to notice.
Use the appropriate data type for the data value that you are going to store. Test. If performance is unacceptable, then come back and do strange things (like binary(8) in the name of performance)
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #1393628
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.