SQLite Forum

sqlar: is it reliable to use length(sqlar.blob)==sqlar.sz determine whether the data is compressed
> I don't follow the code. Could you explain it in plain language how it determines whether it is compressed or not in the case that I mentioned?

In the very last block it checks whether the compressed data is smaller than the original. If so, it keeps the compressed data, else the compression is discarded and the original is retained.