By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,659 Members | 940 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,659 IT Pros & Developers. It's quick & easy.

VARCHAR vs. LONG VARCHAR

P: n/a

What is the difference? Is LONG VARCHAR only 28 bytes longer then VARCHAR?
Is this the only difference?
Jun 28 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"John Smith" <jo********@microsoft.com> wrote in message
news:JG********************@news.siol.net...

What is the difference? Is LONG VARCHAR only 28 bytes longer then VARCHAR?
Is this the only difference?


Originally VARCHAR was limited to a length of 255, so LONG VARCHAR was
needed, but obviously they both support about 32K now (VARCHAR supports 28
bytes less as you mentioned).

One big difference between VARCHAR and LONG VARCHAR is that LONG VARCHAR is
stored in a separate area like a LOB (CLOB, BLOB, etc) and also like a LOB,
does not use bufferpools, so every select, insert, update, or delete of a
LONG VARCHAR requires direct disk I/O, just like LOBs.

In order to use the 32K bufferpool for VARCHAR, they had to make the maximum
size 28 bytes shy of 32K (although you may have to make it even smaller to
ensure your entire row fits in a 32K page, accounting for page and row
overhead)..

For this reason (and because IBM will be phasing out LONG VARCHAR in a
future release), you should not use LONG VARCHAR on any new development.
Jun 28 '06 #2

P: n/a

Thank you.
Jun 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.