Can HSQLDB handle a few millions of rows?

2019-07-03 15:33发布

问题:

I'm developing a singler user application that needs a database. Most tables will have a reasonable amount of data, but there are a few that may grow to a few millions of rows. None of my queries will return a large result set.

Anyone know if HSQLDB can handle such a large number of rows?

回答1:

HSQLDB can handle millions of rows. You can try some of the test classes which can create large databases. For example:

http://hsqldb.org/web/hsqlPerformanceTests.html

Or here: http://hsqldb.svn.sourceforge.net/viewvc/hsqldb/base/trunk/src/org/hsqldb/test/

Check the TestCacheSize and TestStressInsert classess.

You should use the built-in backup capability and regularly backup the database.



回答2:

From the official HSQLDB page:

The latest version 2.2.9, released in August, supports up to 270 billion rows of data in a single database.

That said, it all depends on how you're configuring the server, since by default it uses memory tables that will not fit in the standard Heap memory, so you'll have to use cached tables.