?
Solved

What impact on performance does the database column type have in my case?

Posted on 2013-11-26
2
Medium Priority
?
401 Views
Last Modified: 2013-11-26
I currently have a table which contains a VARCHAR(20) column. The assumption that the column will contain a maximum of 20 characters has held for a long time, however recently a need has resulted for it to also contain very long strings. Is there a performance overhead on the table on (i.e inserts/deletes/selects) if I were to change the table to smalltext (or a long varchar). I never need to search on this field, just retrieve and  insert it's value. If so, should I (reluctantly) introduce a separate column for the larger values?

Thanks a million
0
Comment
Question by:paddycobbett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 2000 total points
ID: 39678581
Just change the current column (to varchar(nnnn) or varchar(max), not text).  The overhead in your situation is extremely small.

The only really big issue would be if you UPDATEd the column from a just a few bytes to many bytes, but that doesn't sound like the case here.  Just an initial INSERT of a lot more bytes on occasion won't cause enough overhead to worry about, and any potential solution would almost certainly cause more overhead than just lengthening the column.
0
 
LVL 1

Author Closing Comment

by:paddycobbett
ID: 39678792
That makes perfect sense! Thanks alot
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question