Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Text Compression

Re: Text Compression

From: Kevin Crosbie <caoimhinocrosbai_at_at_yahoo.com>
Date: Fri, 30 Jun 2006 11:54:27 +0200
Message-ID: <44a4f46b$0$19970$88260bb3@news-taz.teranews.com>


Kevin Crosbie wrote:
> Hi,
>
> I'm trying to implement a program in PL/SQL on Oracle 9iR2, OS is Tru64,
> that tells me the size in bytes before and after I compress some text.
> It's a test to see how compressible data is over a moving window.
>
> So, I want something like:
> before := length(text_value);
> after := length(compress(text_value));
>
> This is fine on 10g, as I can use the UTL_COMPRESS package, but there
> doesn't appear to be any built-in support in 9iR2 for text compression.
>
> I have tried a few solutions, calling Java procedures that use a
> DeflaterOutputStream, but I find this quite slow for large pieces of text.
>
> I had thought about trying something like calling zcat as an external
> procedure or directly to the zlib shared library from www.zlib.net, but
> before I embark, I wanted run this by the group as I'm sure someone has
> had to tackle this before.
>
> Another thought I had was to use an uncompressed table and a compressed
> table to see what the size was before and after, but that seems a little
> brutish.
>
> Regards,
>
> Kevin

Does anybody have any suggestions for or experience with this?

I've invested some time in calling zlib compress() as an external procedure which isn't as straight-forward as I had hoped. The shared library needs to be wrapped to support things like null indicators and passing in/out of CLOBS. That's not so difficult, but for some reason,  calling the compress() function gives me an EOF (ORA-03113)... It's quite difficult to debug as it appears that the library itself is doing something that extproc doesn't like, perhaps allocating memory in an unconventional way...

Perhaps this is the wrong newsgroup to be posting this, if so apologies and would be grateful if someone could suggest an alternative.

Thanks. Received on Fri Jun 30 2006 - 04:54:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US