Informix

Expand all | Collapse all

Size of blob column

  • 1.  Size of blob column

    Posted Thu March 18, 2021 11:13 AM
    Hello all,

    I need to know the space allocated by a table that has a byte column in a blobspace. When I look at the size of the table, I don't see the portion of it that is stored in the blobspace. Is there a way to get this information?

    Thanks!

    ------------------------------
    Celso Freitas
    ------------------------------


  • 2.  RE: Size of blob column

    Posted Thu March 18, 2021 11:58 AM

    This  not giving you what you want ?

     

    Select sum(length(blob)) from .... 

     

    Cheers

    Paul

     






  • 3.  RE: Size of blob column

    Posted Thu March 18, 2021 01:05 PM
    might be good enough with large blobs, covering multiple blobpages, but pretty far off with blobs significantly smaller than blobpage size.


    More precise in terms of real blobspace blobpages usage might be:

    select sum((((length(blob_column) - 1) / (blobpage_size - 40))::int + 1) * blobpage_size)/1024 as blob_column_kB  from ...

    ------------------------------
    Andreas Legner
    ------------------------------



  • 4.  RE: Size of blob column

    Posted Thu March 18, 2021 02:09 PM

    Or, simpler (maybe):

    SELECT SUM(((length(blobcol) + blobpagesize - 41)/(blobpagesize - 40)) * blobpagesize)/1024 AS blobtotal_kb FROM mytable;



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 5.  RE: Size of blob column

    Posted 28 days ago
    Thanks Paul, Andreas and Art!

    Regards​

    ------------------------------
    Celso Freitas
    ------------------------------