Performance BLOB vs LVARCHAR
Posted in 2004
Topics: Performance & Tuning, Data Types & Schema Design
I am looking to for any timing info on SELECT's from a blob column versus a varchar column of the same size. Is there any advantage of using a varchar over a blob provided the data will work in either case? I have a table that has a blob column but possibly can be converted to a lvarchar. Thanks in advance
"Scott" <ssssbbbb1234@yahoo.com> wrote in message news:c4c9f595.0408181234.547fd663@posting.google.com...
> I am looking to for any timing info on SELECT's from a blob column
> versus a varchar column of the same size.
>
> Is there any advantage of using a varchar over a blob provided the
> data will work in either case?
You mention both varchar and lvarchar. I am assuming it is lvarchar.
I am also assuming that it you are comparing TEXT field vs LVARCHAR.
AFAIK TEXT field requires some sort of special coding, for SELECT,
INSERT and UPDATE. OTOH LVARCHAR can be coded as if it is a CHAR,VARCHAR
field. Actually LVARCHAR can not be directly transfered to a C char
variable because its structure is different. You can however typecast it
to a char field.
Assuming fld2 is a LVARCHAR field
select fld1,fld2::char(2048)
from ...
In version 9.21 LVARCHAR can be of max 2K. Depending on your version
you can typecast it to appropriate max size. In your host C variable,
you can transfer the value to a char[2049] size variable.
Avantages of TEXT field:-
TEXT fields, if created in BOLBSPACE can bypass buffers. You don't
have that luxury with LVARCHAR field.
> I have a table that has a blob column but possibly can be converted to
> a lvarchar.
>
> Thanks in advance