On Fri, 2004-06-25 at 20:30, Anima wrote:

> I am using Syabse::DBD 1.02. Currently we are storing images and text 
> files in a Sybase TEXT column after converting to Hexadecimal. The data 
> is doubled in storage size due to the conversion. We are having db space 
> issues due to that.

IMAGE and TEXT use the same underlying storage mechanism. The difference
is that IMAGE is a binary storage - no character set conversion of any
sort happens during either inserts or fetches.

I would definitely store images on IMAGE columns - and you should be
able to use DBD::Sybase 1.02 (or later - 1.04 is the current version) to
do this.

Even if you perform an insert with a hex string for the image (i.e.
something like "insert foo (id, data) values(1, 0xdeadbeef)") the actual
data stored wouldn't be the hex string, but the binary representation.

You can also use the BLOB write API (ct_send_data, and friends) to send
the binary data to the server without converting to a hex string first.

That said - IMAGE and TEXT columns are NOT space efficient, as each data
item is stored on its own page chain. Assuming a server with 2k pages
(the default) a row with one IMAGE column that contains a single byte
will take up 2k of storage (one page for the IMAGE column, plus some
storage on a different page for the rest of the row).

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
[EMAIL PROTECTED]                       http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short
or long term contract positions - http://www.peppler.org/resume.html


Reply via email to