How to analyse existing blobs
Posted in 2004
Topics: Storage & Space Management
Hi folks I've never used blobs, but now I'm helping to resize and reorganize an engine. How do I get a dump of the sizes of existing blobs used in their live data? I want to work out a decent pageunit to use to optimise space and time on the bulk of their blobs thanks in advance. oh - another Q. Once we've created a blob space, what's the trick (if any) for relocating their existing in-table blobs out to a blobspace? Just a simple application of the ALTER TABLE command in the expected manner?
Andrew Hamm wrote:
> I've never used blobs, but now I'm helping to resize and reorganize an
> engine.
>
> How do I get a dump of the sizes of existing blobs used in their live data?
> I want to work out a decent pageunit to use to optimise space and time on
> the bulk of their blobs
SELECT blobid, LENGTH(blob_col) FROM blobby_table;
You might need OCTET_LENGTH for byte blobs; LENGTH should be correct
for TEXT blobs. (I've not checked the manual to see what it says
about this.)
> oh - another Q. Once we've created a blob space, what's the trick (if any)
> for relocating their existing in-table blobs out to a blobspace? Just a
> simple application of the ALTER TABLE command in the expected manner?
Sounds plausible, doesn't it...I see nothing in the manual to indicate
otherwise, but it isn't an in-place alter, and it might not be all
that fast!
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Jonathan Leffler wrote:
> Andrew Hamm wrote:
>> I've never used blobs, but now I'm helping to resize and reorganize
>> an engine.
>>
>> How do I get a dump of the sizes of existing blobs used in their
>> live data? I want to work out a decent pageunit to use to optimise
>> space and time on the bulk of their blobs
>
> SELECT blobid, LENGTH(blob_col) FROM blobby_table;>
> You might need OCTET_LENGTH for byte blobs; LENGTH should be correct
> for TEXT blobs. (I've not checked the manual to see what it says
> about this.)
great - thanks. TFM didn't mention anything about this when I checked the
index for all BLOB and BYTE sections. Tut Tut.
>> oh - another Q. Once we've created a blob space, what's the trick
>> (if any) for relocating their existing in-table blobs out to a
>> blobspace? Just a simple application of the ALTER TABLE command in
>> the expected manner?
>
> Sounds plausible, doesn't it...I see nothing in the manual to indicate
> otherwise, but it isn't an in-place alter, and it might not be all
> that fast!
that's fine, the alternative is an unload/reload with the consequences of
that I guess.
Thanks.