Hi, El 11/10/10 03:44, HJ escribió: > Thank you very much for your answer. Indeed your way works fine. > Instead of 70MB for 40000 such texts i need slightly more then 30MB. > But if I store this text as a normal text to a file then the size is > 20MB. If i compress it in java and save it to a file the the size is > around 10MB. Hence also the 30MB is far to much (usually its rather > 5GB) compared to saving pointers for a file. > > Do you have any idea why H2 enlarges the data so much?
Are your compressing a large text file in a single compression operation ? If that the case, then deflate efficiency can rise up values very high ( <80%), in comparison to compress many small field's value individually. As far as I know H2's (and most databases) internal storage for binary data don't add too much to the real size. I imagine that the only wasted space can be fractions of storage's pages. You can try with different page's size and see what happen with the overall database size ( http://www.h2database.com/html/features.html?highlight=page&search=page#page_size ). BTW, if your intention it's distribute this data content with or to users of your application , may be would be more efficient distribute your data as a compressed csv file or script backup. To deploy you can use: SCRIPT DROP TO '~/.h2db/mydatabase/backup/mydatabase_SQL-BACKUP.gz' COMPRESSION GZIP; On application or client size you recover the database with something like: RUNSCRIPT FROM '~/.h2db/mydatabase/backup/mydatabase_SQL-BACKUP.gz' COMPRESSION GZIP; In many cases the script compressed file is about 15% of total database size. regards, Dario -- 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.
