SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Data Type and SQL performance
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mikeallenbrown
Starting Member

USA
40 Posts

Posted - 09/11/2013 :  17:58:55  Show Profile  Reply with Quote
Does the data type effect SQL's performance? ...I have a table that has around 300 rows. About 25 of those rows are varchar(max). Most other rows are varchar(XX) and BIT. Does the data type matter at all? ...I'm still a SQL noobie.

Thanks in advance

-Mike

Mike Brown

Lamprey
Flowing Fount of Yak Knowledge

4360 Posts

Posted - 09/11/2013 :  18:31:31  Show Profile  Reply with Quote
It can to some degree. I’d focus on modeling the data appropriately. If that means you have a lot of NVARCHAR(MAX) columns, then so be it. If you find performance is an issue, then you can look at breaking those column out into another table. But, I’ve seen tables with millions/billions of rows that perform just fine, given the right indexing.
Go to Top of Page

ScottPletcher
Constraint Violating Yak Guru

USA
279 Posts

Posted - 09/12/2013 :  16:21:42  Show Profile  Reply with Quote
Yes, data type does affect performance. Any LOB (length=MAX) has some extra overhead.

But technically even varchar(3) is less efficient than char(3), smallint less than int, etc., although the difference on those are so slight it would probably take a huge number of rows to notice.

For only 300 rows, I doubt you'll see any noticeable difference with any data types.
Go to Top of Page

mikeallenbrown
Starting Member

USA
40 Posts

Posted - 09/13/2013 :  08:16:52  Show Profile  Reply with Quote
Thanks for the info!



Mike Brown
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000