Friday, October 22, 2004

Caveats of the TEXT datatype [SQL Server]

Caveats of the TEXT datatype

Some interesting information on the SQL Server TEXT data type and space used between NULL and an empty string ("").

Given the millions of rows I'm dealing with, a few bytes can make a big difference.

What's nice is the suggested change (setting the "Text in row" on for the table with text and setting the text length way down) can be done without any client code changes.

"...So what does this tell us? I'm thinking that as a best practice, perhaps the text-in-row option should be used for every table with LOB columns, and that it should be set to around 100 bytes. This will still keep row sizes down when larger data is inserted (as it will go off-row), but it will also keep overall IO way down if the amount of rows with LOB data larger than 100 bytes is fairly sparse. "

I agree (once I test this myself :)

No comments:

Post a Comment

NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...

ALL comments are moderated. I will review every comment before it will appear on the blog.

Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...

I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...

Please see my comment policy for more information if you are interested.

Thanks,
Greg

PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...