What is the best way to store large text values?

61 views
Skip to first unread message

Andrey Aunmag

unread,
Mar 4, 2020, 6:35:41 AM3/4/20
to H2 Database

I have a table which contains large JSON text, each row is about 100 KB. So entire database file may grow up to 15 GB, which makes it very slow, it even takes forever to open the database. Despite the fact that c_data is a CLOB column.

create table t_data (
    id                            integer auto_increment not null,
    c_some_column_1               integer,
    c_some_column_2               integer,
    c_data                        text,
    constraint pk_t_data primary key (id)
);

Am I doing something wrong? Should I store the data in separate text files to keep DB as lightweight and quick as possible? Are there better solutions?

I use H2 database 1.4.197.

Message has been deleted

Andrey Aunmag

unread,
Mar 31, 2020, 4:16:15 AM3/31/20
to H2 Database
So, I suppose H2 isn't good at this, and it would be better to use an another DB. Can you give me some advice?

Noel Grandin

unread,
Mar 31, 2020, 4:50:14 AM3/31/20
to h2-da...@googlegroups.com
If you're shutting the DB down normally, it should start up pretty quickly.

H2 is unfortunately not great with TEXT/LOB data. At that size you could try storing it in a VARCHAR column.

You'll have to be more specific about what exactly is slow.
Reply all
Reply to author
Forward
0 new messages