??? <2004wqg2008 at 163.com> wrote:

> HI,all
>     SQLite retrieves the compressed records is slower than the uncompressed 
> records about 30%.
>     How can improve the problem?  and anyone any suggustion?
>
>     best regards
>     wqg


What is your SQLite page size?  If you access small
records, you're better off with a small page size (fewer
bytes to read and decompress).  If you have large BLOBs
you can afford large page sizes (better compression, which
can result in less I/Os).

Which compression algorithm are you using? You can
see the compression algorithm the first few bytes of
the database file. Some compression algorithms are
faster than others. For example, lz4hc decompression
is much faster than zlib (about 10x faster I think) at
the cost of compressing less than zlib.

Are you reading only or also writing to the DB? Some
algorithms have very different speed for compression
and decompression.

And of course, make sure that your queries minimize
the number of SQLite pages read, which is always good
whether you compress, but especially true with compressed
DB. Watch for queries doing full table scan, etc.

Regards
Dominique

Reply via email to