0

As remembered here, when storing documents (suppose text or xml datatypes and EXTENDED storage) with more than 2k, it is compressed.

About table columns that was compressed, how to retrieve the compressed (binary format) of the column?


NOTE - Typical applications:

  • Operations as "long-term checksum of the document", like SHA256(compressed).
    PS: as it is a matter of convention, not needs complementar compression, inheriting the condition, SHA256(less2k? text: compressed).

  • Coping or downloading compressed documents directally (without CPU consume).
    PS: complementing operation (for "less than 2k row") with on-the-fly compression, when uniformity is required.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Peter Krauss
  • 13,174
  • 24
  • 167
  • 304

1 Answers1

2

If this is possible at all, it would require writing a function in C.

Instead of going that way, I would recommend that you use EXTERNAL rather than EXTENDED storage and compress the data yourself before you store them in the database. That way you don't waste any space, and you can decide when to retrieve the compressed data and when to uncompress them.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263