On Oct 7, 11:46 pm, Thomas Mueller <[email protected]>
wrote:
> Hi,
>
> > I m using H2 for a project where one of the functions is to store text
> > of a size 100-2000 characters.  This text is highly compressible.
> > Hence I have three questions:
>
> > 1. Is there a way to compact  a String within H2. COMPRESS does not
> > seem to reach the desired size. Actually it is getting even larger.
>
> How exactly did you use the COMPRESS function? Could you provide some
> sample data?
>
> Regards,
> Thomas

Dear Thomas,

Thank you much for your answer. The data I want to store is actually
an output from a biological alignment algorithm called blast.

A good example for a single field which should be stored in the
database is:

"
>sp|P08506|DACC_ECOLI PENICILLIN-BINDING PROTEIN 6 PRECURSOR
            (D-ALANYL-D-ALANINE CARBOXYPEPTIDASE FRACTION C) (EC
3.4.16.4)
            (DD-PEPTIDASE) (DD-CARBOXYPEPTIDASE) (PBP-6).
            Length = 400

  Score = 894 (409.5 bits), Expect = 5.0e-120, P = 5.0e-120
 Identities = 169/342 (49%), Positives = 237/3 42 (69%)

Query:     1
MDYTTGQILTAGNEHQQRNPASLTKLMTGYVVDRAIDSHRITPDDIVTVGRDAWAKDNPV 60
             MDY +G++L  GN  ++ +PASLTK+MT YVV +A+ + +I   D+VTVG+DAWA
NP
Sbjct:    45
MDYASGKVLAEGNADEKLDPASLTKIMTSYVVGQALKADKIKLTDMVTVGKDAWATGNPA 104

Query:    61
FVGSSLMFLKEGDRVSVRDLSRGLIVDSGNDACVALADYIAGGQRQFVEMMNNYAEKLHL 120
               GSS+MFLK GD+VSV DL++G+I+ SGNDAC+ALADY+AG Q  F+ +MN YA
+KL L
Sbjct:   105
LRGSSVMFLKPGDQVSVADLNKGVIIQSGNDACIALADYVAGSQESFIGLMNGYAKKLGL 164

Query:   121
KDTHFETVHGLDAPGQHSSAYDLAVLSRAIIHGEPEFYHMYSEKSLTWNGITQQNRNGLL 180
              +T F+TVHGLDAPGQ S+A D+A+L +A+IH  PE Y ++ EK  T+N I Q NRN
LL
Sbjct:   165
TNTTFQTVHGLDAPGQFSTARDMALLGKALIHDVPEEYAIHKEKEFTFNKIRQPNRNRLL 224

Query:   181
WDKTMNVDGLKTGHTSGAGFNLIASAVDGQRRLIAVVMGADSAKGREEEARKLLRWGQQN 240
             W   +N DG+KTG T+GAG+NL+ASA  G  RLI+VV+GA + + R  E+ KLL WG
+
Sbjct:   225
WSSNLNEDGMKTGTTAGAGYNLVASATQGDMRLISVVLGAKTDRIRFNESEKLLTWGFRF 284

Query:   241
FTTVQILHRGKKVGTERIWYGDKENIDLGTEQEFWMVLPKAEIPHIKAKYTLDGKELTAP 300
             F TV  +       T+R+W+GDK  ++LG  +   + +P+ ++ ++KA YTL
+LTAP
Sbjct:   285
FETVTPIKPDATFVTQRVWFGDKSEVNLGAGEAGSVTIPRGQLKNLKASYTLTEPQLTAP 344

Query:   301 ISAHQRVGEIELYDRDKQVAHWPLVTLESVGEGSMFSRLSDY 342
             +   Q VG I+     K +   PL+ +E+V EG  F R+ D+
Sbjct:   345 LKKGQVVGTIDFQLNGKSIEQRPLIVMENVEEGGFFGRVWDF 386
"


If i store around 40,000 of them to the database using
COMPRESS(STRINGTOUTF8('text')) then i get a database size of around
30MB. If I store them as a pure text then the size grows to around 65
MB. (All considering an unindexed table with one column). If on the
other hand I use the Java to compress every single text and write the
result as an byte array to the disk then the size shrinks to around
10MB.

Since 40,000 is a tiny dataset (rather consider up to 10mio) this size
requirements really stop me storing this information into the
database. Pls take into account that this data is read only data which
will never be changed and also only rarely used. At the moment I store
instead of the text rather a pointer to the desired position on the
disk file since this shrinks the space requirements by 66% which is a
not to elegant when considering that this datasets are being exchanged
between users.

Thank you very much,

HJ

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to