Re: Varchars Vs Chars - Performance -Reply
Posted in 1997
On Mon, 30 Jun 1997, David Williams wrote: > This means the CPU overhead is swamped by the savings in disk I/O > since you are reading a lot less blocks of the disk. Remember > 1 disk rotation or 1 disk seek takes the same time as LOTS of CPU > cycles. This can hold true if the VARCHAR field is never expanded. Once a row is created, if the field is updated to a larger size then an additional page will be referenced. This can cause some quite dramatic slowdowns. IMO, they're very useful in certain situations, including the "99.99% are 20 characters, the others are 200" scenario and in shops where diskspace is at a premium but time is not. For the most part, though, we've found them too much of a performance drain. Also note that an index created on a VARCHAR column will use 255 bytes (or the spevified maximum value) for each entry in that index. It does this due to the performance degredation experienced. If you index a varchar, you're quite possibly taking up /more/ space than using a CHAR :) -Richard