提交 27d7b7d3 authored 作者: Thomas Mueller's avatar Thomas Mueller

Improved docs.

上级 d396f152
...@@ -143,7 +143,7 @@ target database, that means no joins. Prepared statements are used where possibl ...@@ -143,7 +143,7 @@ target database, that means no joins. Prepared statements are used where possibl
To view the statements that are executed against the target table, set the trace level to 3. To view the statements that are executed against the target table, set the trace level to 3.
</p> </p>
<p> <p>
There is a restriction: When inserting into a linked table, and when updating a linked table, There is a restriction: when inserting into a linked table, and when updating a linked table,
NULL and values that are not set are both inserted as NULL. NULL and values that are not set are both inserted as NULL.
This may not have the desired effect if the default value for this column in the target table is not NULL. This may not have the desired effect if the default value for this column in the target table is not NULL.
</p> </p>
...@@ -592,10 +592,10 @@ class Test ...@@ -592,10 +592,10 @@ class Test
In the database world, ACID stands for: In the database world, ACID stands for:
</p> </p>
<ul> <ul>
<li>Atomicity: Transactions must be atomic, meaning either all tasks are performed or none. <li>Atomicity: transactions must be atomic, meaning either all tasks are performed or none.
</li><li>Consistency: All operations must comply with the defined constraints. </li><li>Consistency: all operations must comply with the defined constraints.
</li><li>Isolation: Transactions must be isolated from each other. </li><li>Isolation: transactions must be isolated from each other.
</li><li>Durability: Committed transaction will not be lost. </li><li>Durability: committed transaction will not be lost.
</li></ul> </li></ul>
<h3>Atomicity</h3> <h3>Atomicity</h3>
...@@ -645,8 +645,8 @@ is to use the 'synchronous write' file access mode. In Java, RandomAccessFile ...@@ -645,8 +645,8 @@ is to use the 'synchronous write' file access mode. In Java, RandomAccessFile
supports the modes "rws" and "rwd": supports the modes "rws" and "rwd":
</p> </p>
<ul> <ul>
<li>rwd: Every update to the file's content is written synchronously to the underlying storage device. <li>rwd: every update to the file's content is written synchronously to the underlying storage device.
</li><li>rws: In addition to rwd, every update to the metadata is written synchronously.</li> </li><li>rws: in addition to rwd, every update to the metadata is written synchronously.</li>
</ul> </ul>
<p> <p>
A test (org.h2.test.poweroff.TestWrite) with one of those modes achieves around 50 thousand write operations per second. A test (org.h2.test.poweroff.TestWrite) with one of those modes achieves around 50 thousand write operations per second.
...@@ -983,7 +983,7 @@ This is to make sure the IV is unknown to the attacker. ...@@ -983,7 +983,7 @@ This is to make sure the IV is unknown to the attacker.
The reason for using a secret IV is to protect against watermark attacks. The reason for using a secret IV is to protect against watermark attacks.
</p><p> </p><p>
Before saving a block of data (each block is 8 bytes long), the following operations are executed: Before saving a block of data (each block is 8 bytes long), the following operations are executed:
First, the IV is calculated by encrypting the block number with the IV key (using the same first, the IV is calculated by encrypting the block number with the IV key (using the same
block cipher algorithm). This IV is combined with the plain text using XOR. The resulting data is block cipher algorithm). This IV is combined with the plain text using XOR. The resulting data is
encrypted using the AES-128 or XTEA algorithm. encrypted using the AES-128 or XTEA algorithm.
</p><p> </p><p>
...@@ -1084,7 +1084,7 @@ Some values are: ...@@ -1084,7 +1084,7 @@ Some values are:
</pre> </pre>
<p> <p>
To help non-mathematicians understand what those numbers mean, here a comparison: To help non-mathematicians understand what those numbers mean, here a comparison:
One's annual risk of being hit by a meteorite is estimated to be one chance in 17 billion, one's annual risk of being hit by a meteorite is estimated to be one chance in 17 billion,
that means the probability is about 0.000'000'000'06. that means the probability is about 0.000'000'000'06.
</p> </p>
...@@ -1125,8 +1125,7 @@ This database has the following known limitations: ...@@ -1125,8 +1125,7 @@ This database has the following known limitations:
</p> </p>
<ul> <ul>
<li>The maximum file size is currently 256 GB for the data, and 256 GB for the index. <li>The maximum file size is currently 256 GB for the data, and 256 GB for the index.
This number is excluding BLOB and CLOB data: This number is excluding BLOB and CLOB data: every CLOB or BLOB can be up to 256 GB as well.
Every CLOB or BLOB can be up to 256 GB as well.
</li><li>The maximum file size for FAT or FAT32 file systems is 4 GB. That means when using FAT or FAT32, </li><li>The maximum file size for FAT or FAT32 file systems is 4 GB. That means when using FAT or FAT32,
the limit is 4 GB for the data. This is the limitation of the file system. The database does provide a the limit is 4 GB for the data. This is the limitation of the file system. The database does provide a
workaround for this problem, it is to use the file name prefix 'split:'. In that case files are split into workaround for this problem, it is to use the file name prefix 'split:'. In that case files are split into
......
...@@ -98,10 +98,10 @@ build switchSource ...@@ -98,10 +98,10 @@ build switchSource
<p> <p>
The build system can generate smaller jar files as well. The following targets are currently supported: The build system can generate smaller jar files as well. The following targets are currently supported:
</p> </p>
<ul><li>jarClient: Create the h2client.jar. This only contains the JDBC client. <ul><li>jarClient creates the h2client.jar. This only contains the JDBC client.
</li><li>jarSmall: Create the file h2small.jar. This only contains the embedded database. Debug information is disabled. </li><li>jarSmall creates the file h2small.jar. This only contains the embedded database. Debug information is disabled.
</li><li>jarJaqu: Create the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu. </li><li>jarJaqu creates the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu.
</li><li>javadocImpl: Create the Javadocs of the implementation. </li><li>javadocImpl creates the Javadocs of the implementation.
</li></ul> </li></ul>
<p> <p>
To create the h2client.jar file, go to the directory h2 and execute the following command: To create the h2client.jar file, go to the directory h2 and execute the following command:
...@@ -179,7 +179,7 @@ If you like to provide patches, please consider the following guidelines to simp ...@@ -179,7 +179,7 @@ If you like to provide patches, please consider the following guidelines to simp
For SQL level tests, see <code>src/test/org/h2/test/test.in.txt</code> or <code>testSimple.in.txt</code>. For SQL level tests, see <code>src/test/org/h2/test/test.in.txt</code> or <code>testSimple.in.txt</code>.
</li><li>The test cases should cover at least 90% of the changed and new code; use a code coverage tool to verify that (see above). </li><li>The test cases should cover at least 90% of the changed and new code; use a code coverage tool to verify that (see above).
or use the build target 'coverage'. or use the build target 'coverage'.
</li><li>Verify that you did not break other features: Run the test cases by executing <code>build test</code>. </li><li>Verify that you did not break other features: run the test cases by executing <code>build test</code>.
</li><li>Provide end user documentation if required (<code>src/docsrc/html/*</code>). </li><li>Provide end user documentation if required (<code>src/docsrc/html/*</code>).
</li><li>Document grammar changes in <code>src/main/org/h2/res/help.csv</code> </li><li>Document grammar changes in <code>src/main/org/h2/res/help.csv</code>
</li><li>Provide a change log entry (<code>src/docsrc/html/changelog.html</code>). </li><li>Provide a change log entry (<code>src/docsrc/html/changelog.html</code>).
......
...@@ -76,7 +76,7 @@ Change Log ...@@ -76,7 +76,7 @@ Change Log
<h2>Version 1.1.114 (2009-06-01)</h2> <h2>Version 1.1.114 (2009-06-01)</h2>
<ul><li>ResultSetMetaData.getColumnClassName returned the wrong <ul><li>ResultSetMetaData.getColumnClassName returned the wrong
class for CLOB and BLOB columns. class for CLOB and BLOB columns.
</li><li>Fulltext search: Data is no longer deleted and </li><li>Fulltext search: data is no longer deleted and
re-inserted if the indexed columns didn't change. re-inserted if the indexed columns didn't change.
</li><li>In some situations, an ArrayIndexOutOfBoundsException was thrown when adding rows. </li><li>In some situations, an ArrayIndexOutOfBoundsException was thrown when adding rows.
This was caused by a bug in the b-tree code. This was caused by a bug in the b-tree code.
...@@ -105,7 +105,7 @@ Change Log ...@@ -105,7 +105,7 @@ Change Log
</li><li>Identifiers with a digit and then a dollar sign didn't work. Example: A1$B. </li><li>Identifiers with a digit and then a dollar sign didn't work. Example: A1$B.
</li><li>MS SQL Server compatibility: support for linked tables with </li><li>MS SQL Server compatibility: support for linked tables with
NVARCHAR, NCHAR, NCLOB, and LONGNVARCHAR. NVARCHAR, NCHAR, NCLOB, and LONGNVARCHAR.
</li><li>Android: Workaround for a problem when using read-only databases in zip files </li><li>Android: workaround for a problem when using read-only databases in zip files
(skip seems to be implemented incorrectly on the Android system). (skip seems to be implemented incorrectly on the Android system).
</li><li>Calling execute() or prepareStatement() with null as the SQL statement </li><li>Calling execute() or prepareStatement() with null as the SQL statement
now throws an exception. now throws an exception.
...@@ -125,7 +125,7 @@ Change Log ...@@ -125,7 +125,7 @@ Change Log
<h2>Version 1.1.112 (2009-05-01)</h2> <h2>Version 1.1.112 (2009-05-01)</h2>
<ul><li>JdbcPreparedStatement.toString() could throw a NullPointerException. <ul><li>JdbcPreparedStatement.toString() could throw a NullPointerException.
</li><li>EclipseLink: Added H2Platform.supportsIdentity(). </li><li>EclipseLink: added H2Platform.supportsIdentity().
</li><li>Connection pool: the default login timeout is now 5 minutes. </li><li>Connection pool: the default login timeout is now 5 minutes.
</li><li>After truncating tables, opening large databases could become slow </li><li>After truncating tables, opening large databases could become slow
because indexes were always re-built unnecessarily when opening. because indexes were always re-built unnecessarily when opening.
...@@ -247,7 +247,7 @@ Change Log ...@@ -247,7 +247,7 @@ Change Log
should give slightly better query plans when using many joins. should give slightly better query plans when using many joins.
</li><li>Improved exception message when connecting to a just started server fails. </li><li>Improved exception message when connecting to a just started server fails.
</li><li>Connection.isValid is a bit faster. </li><li>Connection.isValid is a bit faster.
</li><li>H2 Console: The autocomplete feature has been improved a bit. It can now better </li><li>H2 Console: the autocomplete feature has been improved a bit. It can now better
parse conditions. parse conditions.
</li><li>When restarting a web application in Tomcat, an exception was thrown sometimes. </li><li>When restarting a web application in Tomcat, an exception was thrown sometimes.
In most cases this was a NullPointerException. A workaround in H2 has been implemented. In most cases this was a NullPointerException. A workaround in H2 has been implemented.
...@@ -270,9 +270,9 @@ Change Log ...@@ -270,9 +270,9 @@ Change Log
<h2>Version 1.1.106 (2009-01-04)</h2> <h2>Version 1.1.106 (2009-01-04)</h2>
<ul><li>Statement.setQueryTimeout did not work correctly for some statements. <ul><li>Statement.setQueryTimeout did not work correctly for some statements.
</li><li>CREATE DOMAIN: Built-in data types can now only be changed if no tables exist. </li><li>CREATE DOMAIN: built-in data types can now only be changed if no tables exist.
</li><li>Linked tables: a workaround for Oracle DATE columns has been implemented. </li><li>Linked tables: a workaround for Oracle DATE columns has been implemented.
</li><li>DatabaseMetaData.getPrimaryKeys: The column PK_NAME now contains the </li><li>DatabaseMetaData.getPrimaryKeys: the column PK_NAME now contains the
constraint name instead of the index name (compatibility for PostgreSQL and Derby). constraint name instead of the index name (compatibility for PostgreSQL and Derby).
</li><li>Using IN(..) inside a IN(SELECT..) did not always work. </li><li>Using IN(..) inside a IN(SELECT..) did not always work.
</li><li>Views with IN(..) that used a view itself did not work. </li><li>Views with IN(..) that used a view itself did not work.
...@@ -283,7 +283,7 @@ Change Log ...@@ -283,7 +283,7 @@ Change Log
</li><li>Constraints for local temporary tables now session scoped. So far they were global. </li><li>Constraints for local temporary tables now session scoped. So far they were global.
Thanks a lot to Eric Faulhaber for finding and fixing this problem! Thanks a lot to Eric Faulhaber for finding and fixing this problem!
</li><li>When using the auto-server mode, and if the lock file was modified in the future, </li><li>When using the auto-server mode, and if the lock file was modified in the future,
the wrong exception was thrown ('Connection is broken' instead of 'Error opening database: Lock file modified in the future'). the wrong exception was thrown ('Connection is broken' instead of 'Error opening database: lock file modified in the future').
</li></ul> </li></ul>
<h2>Version 1.1.105 (2008-12-19)</h2> <h2>Version 1.1.105 (2008-12-19)</h2>
...@@ -304,7 +304,7 @@ Change Log ...@@ -304,7 +304,7 @@ Change Log
</li><li>New meta data column INFORMATION_SCHEMA.TABLES.LAST_MODIFICATION to get </li><li>New meta data column INFORMATION_SCHEMA.TABLES.LAST_MODIFICATION to get
the table modification counter. the table modification counter.
</li><li>Shell: line comments didn't work correctly. </li><li>Shell: line comments didn't work correctly.
</li><li>H2 Console: Columns are now listed for up to 500 tables instead of 100. </li><li>H2 Console: columns are now listed for up to 500 tables instead of 100.
</li><li>H2 Console: Cmd+Enter executes the current statement, Alt+Space for autocomplete. </li><li>H2 Console: Cmd+Enter executes the current statement, Alt+Space for autocomplete.
</li><li>JaQu: the maximum length of a column can now be defined using maxLength. </li><li>JaQu: the maximum length of a column can now be defined using maxLength.
For an example, see Product.java (maxLength(category, 255)). For an example, see Product.java (maxLength(category, 255)).
...@@ -368,7 +368,7 @@ Change Log ...@@ -368,7 +368,7 @@ Change Log
</li><li>The Japanese translation has been completed by Masahiro Ikemoto. </li><li>The Japanese translation has been completed by Masahiro Ikemoto.
Thanks a lot! Thanks a lot!
</li><li>Improved PostgreSQL compatibility for NEXTVAL and CURRVAL. </li><li>Improved PostgreSQL compatibility for NEXTVAL and CURRVAL.
</li><li>Less heap memory is needed when multiple databases are open at the same time: The memory reserve </li><li>Less heap memory is needed when multiple databases are open at the same time: the memory reserve
(used to rollback after out of memory) is now global and no longer allocated for each database separately. (used to rollback after out of memory) is now global and no longer allocated for each database separately.
</li><li>New system property h2.browser to set the browser to use. </li><li>New system property h2.browser to set the browser to use.
</li><li>To start the browser, java.awt.Desktop.browse is now used if available. </li><li>To start the browser, java.awt.Desktop.browse is now used if available.
...@@ -553,7 +553,7 @@ Change Log ...@@ -553,7 +553,7 @@ Change Log
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3401 http://opensource.atlassian.com/projects/hibernate/browse/HHH-3401
</li><li>ORDER BY on tableName.columnName didn't work correctly if the column </li><li>ORDER BY on tableName.columnName didn't work correctly if the column
name was also used as an alias. name was also used as an alias.
</li><li>H2 Console: The progress display when opening a database has been improved. </li><li>H2 Console: the progress display when opening a database has been improved.
</li><li>The error message when the server doesn't start has been improved. </li><li>The error message when the server doesn't start has been improved.
</li><li>Key values can now be changed in updatable result sets. </li><li>Key values can now be changed in updatable result sets.
</li><li>Changes in updatable result sets are now visible even when resetting the result set. </li><li>Changes in updatable result sets are now visible even when resetting the result set.
......
...@@ -916,7 +916,7 @@ SET DEFAULT_LOCK_TIMEOUT &lt;milliseconds&gt;. The default lock timeout is persi ...@@ -916,7 +916,7 @@ SET DEFAULT_LOCK_TIMEOUT &lt;milliseconds&gt;. The default lock timeout is persi
<p> <p>
There are a number of files created for persistent databases. Unlike some other databases, There are a number of files created for persistent databases. Unlike some other databases,
not every table and/or index is stored in its own file. Instead, usually only the following files are created: not every table and/or index is stored in its own file. Instead, usually only the following files are created:
A data file, an index file, a log file, and a database lock file (exists only while the database is in use). a data file, an index file, a log file, and a database lock file (exists only while the database is in use).
In addition to that, a file is created for each large object (CLOB/BLOB) larger than a certain size, In addition to that, a file is created for each large object (CLOB/BLOB) larger than a certain size,
and temporary files for large result sets. and temporary files for large result sets.
If the database trace option is enabled, trace files are created. If the database trace option is enabled, trace files are created.
...@@ -1177,7 +1177,7 @@ When the first connection is closed, the server stops. If other (remote) connect ...@@ -1177,7 +1177,7 @@ When the first connection is closed, the server stops. If other (remote) connect
open, one of them will then start a server (auto-reconnect is enabled automatically). open, one of them will then start a server (auto-reconnect is enabled automatically).
</p> </p>
<p> <p>
This mode has three disadvantages: All processes need to have access to the database files. This mode has three disadvantages: all processes need to have access to the database files.
Then, if the first connection is closed (the connection that started the server), open transactions of Then, if the first connection is closed (the connection that started the server), open transactions of
other connections will be rolled back. other connections will be rolled back.
Also, explicit client/server connections (using jdbc:h2:tcp:// or ssl://) are not supported. Also, explicit client/server connections (using jdbc:h2:tcp:// or ssl://) are not supported.
...@@ -1308,7 +1308,7 @@ To create a read-only database, close the database so that the log file gets sma ...@@ -1308,7 +1308,7 @@ To create a read-only database, close the database so that the log file gets sma
Then, make the database files read-only using the operating system. Then, make the database files read-only using the operating system.
When you open the database now, it is read-only. When you open the database now, it is read-only.
There are two ways an application can find out whether database is read-only: There are two ways an application can find out whether database is read-only:
By calling Connection.isReadOnly() or by executing the SQL statement CALL READONLY(). by calling Connection.isReadOnly() or by executing the SQL statement CALL READONLY().
</p> </p>
<br /><a name="database_in_zip"></a> <br /><a name="database_in_zip"></a>
...@@ -1568,7 +1568,7 @@ CALL SIMPLE(); ...@@ -1568,7 +1568,7 @@ CALL SIMPLE();
<p> <p>
A function that returns a result set can be used like a table. A function that returns a result set can be used like a table.
However, in this case the function is called at least twice: However, in this case the function is called at least twice:
First while parsing the statement to collect the column names first while parsing the statement to collect the column names
(with parameters set to null where not known at compile time). (with parameters set to null where not known at compile time).
And then, while executing the statement to get the data (maybe multiple times if this is a join). And then, while executing the statement to get the data (maybe multiple times if this is a join).
If the function is called just to get the column list, the URL of the connection passed to the function is If the function is called just to get the column list, the URL of the connection passed to the function is
......
...@@ -82,7 +82,7 @@ A lot of features are already built in (for example Unicode, network libraries). ...@@ -82,7 +82,7 @@ A lot of features are already built in (for example Unicode, network libraries).
It is very easy to write secure code because buffer overflows can not occur. It is very easy to write secure code because buffer overflows can not occur.
Some features such as the reflection mechanism can be used for randomized testing. Some features such as the reflection mechanism can be used for randomized testing.
</p><p> </p><p>
Java is also future proof: A lot of companies support Java, Java is also future proof: a lot of companies support Java,
and it is now open source. and it is now open source.
</p><p> </p><p>
This software does not rely on many Java libraries or other software, to This software does not rely on many Java libraries or other software, to
......
...@@ -63,7 +63,7 @@ Boolean, Integer, Long, and Double instead. ...@@ -63,7 +63,7 @@ Boolean, Integer, Long, and Double instead.
<h3>Why in Java?</h3> <h3>Why in Java?</h3>
<p> <p>
Most people use Java in their application. Mixing Java and another language (for example Scala or Groovy) Most people use Java in their application. Mixing Java and another language (for example Scala or Groovy)
in the same application is complicated: You would need to split the application and database code. in the same application is complicated: you would need to split the application and database code.
</p> </p>
<h2>Current State</h2> <h2>Current State</h2>
......
...@@ -35,11 +35,11 @@ There is a License FAQ for both the MPL and the EPL, most of that is applicable ...@@ -35,11 +35,11 @@ There is a License FAQ for both the MPL and the EPL, most of that is applicable
<p> <p>
However, nobody is allowed to rename H2, modify it a little, and sell it as a database engine without telling the customers it is in fact H2. However, nobody is allowed to rename H2, modify it a little, and sell it as a database engine without telling the customers it is in fact H2.
This happened to HSQLDB: A company called 'bungisoft' copied HSQLDB, renamed it to 'RedBase', and tried to sell it, This happened to HSQLDB: a company called 'bungisoft' copied HSQLDB, renamed it to 'RedBase', and tried to sell it,
hiding the fact that it was in fact just HSQLDB. It seems 'bungisoft' does not exist any more, but you can use the hiding the fact that it was in fact just HSQLDB. It seems 'bungisoft' does not exist any more, but you can use the
Wayback Machine of http://www.archive.org and visit old web pages of http://www.bungisoft.com . Wayback Machine of http://www.archive.org and visit old web pages of http://www.bungisoft.com .
</p><p> </p><p>
About porting the source code to another language (for example C# or C++): Converted source code (even if done manually) stays under the same About porting the source code to another language (for example C# or C++): converted source code (even if done manually) stays under the same
copyright and license as the original code. The copyright of the ported source code does not (automatically) go to the person who ported the code. copyright and license as the original code. The copyright of the ported source code does not (automatically) go to the person who ported the code.
</p> </p>
......
...@@ -26,6 +26,8 @@ Performance ...@@ -26,6 +26,8 @@ Performance
Database Profiling</a><br /> Database Profiling</a><br />
<a href="#database_performance_tuning"> <a href="#database_performance_tuning">
Performance Tuning</a><br /> Performance Tuning</a><br />
<a href="#fast_import">
Fast Database Import</a><br />
<br /><a name="performance_comparison"></a> <br /><a name="performance_comparison"></a>
<h2>Performance Comparison</h2> <h2>Performance Comparison</h2>
...@@ -92,7 +94,7 @@ However H2 is not very fast in every case, certain kind of queries may still be ...@@ -92,7 +94,7 @@ However H2 is not very fast in every case, certain kind of queries may still be
One situation where is H2 is slow is large result sets, because they are buffered to One situation where is H2 is slow is large result sets, because they are buffered to
disk if more than a certain number of records are returned. disk if more than a certain number of records are returned.
The advantage of buffering is, there is no limit on the result set size. The advantage of buffering is, there is no limit on the result set size.
The open/close time is almost fixed, because of the file locking protocol: The engine waits The open/close time is almost fixed, because of the file locking protocol: the engine waits
some time after opening a database to ensure the database files are not opened by another process. some time after opening a database to ensure the database files are not opened by another process.
</p> </p>
...@@ -121,7 +123,7 @@ The reason is, a backup of the whole data is made whenever the database is opene ...@@ -121,7 +123,7 @@ The reason is, a backup of the whole data is made whenever the database is opene
Version 10.4.2.0 was used for the test. Derby is clearly the slowest embedded database in this test. Version 10.4.2.0 was used for the test. Derby is clearly the slowest embedded database in this test.
This seems to be a structural problem, because all operations are really slow. This seems to be a structural problem, because all operations are really slow.
It will be hard for the developers of Derby to improve the performance to a reasonable level. It will be hard for the developers of Derby to improve the performance to a reasonable level.
A few problems have been identified: Leaving autocommit on is a problem for Derby. A few problems have been identified: leaving autocommit on is a problem for Derby.
If it is switched off during the whole test, the results are about 20% better for Derby. If it is switched off during the whole test, the results are about 20% better for Derby.
Derby supports a testing mode (system property derby.system.durability=test) where durability is Derby supports a testing mode (system property derby.system.durability=test) where durability is
disabled. According to the documentation, this setting should be used for testing only, disabled. According to the documentation, this setting should be used for testing only,
...@@ -194,8 +196,8 @@ BenchB uses multiple connections; the other tests use one connection. ...@@ -194,8 +196,8 @@ BenchB uses multiple connections; the other tests use one connection.
<h4>Real-World Tests</h4> <h4>Real-World Tests</h4>
<p> <p>
Good benchmarks emulate real-world use cases. This benchmark includes 3 test cases: Good benchmarks emulate real-world use cases. This benchmark includes 4 test cases:
A simple test case with one table and many small updates / deletes. BenchSimple uses one table and many small updates / deletes.
BenchA is similar to the TPC-A test, but single connection / single threaded (see also: www.tpc.org). BenchA is similar to the TPC-A test, but single connection / single threaded (see also: www.tpc.org).
BenchB is similar to the TPC-B test, using multiple connections (one thread per connection). BenchB is similar to the TPC-B test, using multiple connections (one thread per connection).
BenchC is similar to the TPC-C test, but single connection / single threaded. BenchC is similar to the TPC-C test, but single connection / single threaded.
...@@ -471,4 +473,20 @@ By default the cache size of H2 is quite small. Consider using a larger cache si ...@@ -471,4 +473,20 @@ By default the cache size of H2 is quite small. Consider using a larger cache si
the second level soft reference cache. See also <a href="features.html#cache_settings">Cache Settings</a>. the second level soft reference cache. See also <a href="features.html#cache_settings">Cache Settings</a>.
</p> </p>
<br /><a name="fast_import"></a>
<h2>Fast Database Import</h2>
<p>
To speed up large imports, consider using the following options temporarily:
</p>
<ul><li>SET CACHE_SIZE (a large cache is faster)
</li><li>SET LOCK_MODE 0 (disable locking)
</li><li>SET LOG 0 (disable the transaction log)
</li><li>SET UNDO_LOG 0 (disable the session undo log)
</li></ul>
<p>
These options can be set in the database URL:
<code>jdbc:h2:~/test;CACHE_SIZE=65536;LOCK_MODE=0;LOG=0;UNDO_LOG=0</code>.
Most of those options are not recommended for regular use, that means you need to reset them after use.
</p>
<!-- [close] { --></div></td></tr></table><!-- } --><!-- analytics --></body></html> <!-- [close] { --></div></td></tr></table><!-- } --><!-- analytics --></body></html>
...@@ -56,7 +56,7 @@ Install the software using the Windows Installer (if you did not yet do that). ...@@ -56,7 +56,7 @@ Install the software using the Windows Installer (if you did not yet do that).
Click [Start], [All Programs], [H2], and [H2 Console (Command Line)]:<br /> Click [Start], [All Programs], [H2], and [H2 Console (Command Line)]:<br />
<img class="screenshot" src="images/quickstart-1.png" alt="screenshot: start H2 Console" /><br /> <img class="screenshot" src="images/quickstart-1.png" alt="screenshot: start H2 Console" /><br />
A new console window appears:<br /> A new console window appears:<br />
<img class="screenshot" src="images/quickstart-2.png" alt="screenshot: H2 Running" /><br /> <img class="screenshot" src="images/quickstart-2.png" alt="screenshot: H2 running" /><br />
Also, a new browser page should open with the URL <a href="http://localhost:8082">http://localhost:8082</a>. Also, a new browser page should open with the URL <a href="http://localhost:8082">http://localhost:8082</a>.
You may get a security warning from the firewall. If you don't want other computers in the network to access the database You may get a security warning from the firewall. If you don't want other computers in the network to access the database
on your machine, you can let the firewall block these connections. Only local connections are required at this time. on your machine, you can let the firewall block these connections. Only local connections are required at this time.
...@@ -65,7 +65,7 @@ on your machine, you can let the firewall block these connections. Only local co ...@@ -65,7 +65,7 @@ on your machine, you can let the firewall block these connections. Only local co
<h4>Login</h4> <h4>Login</h4>
<p> <p>
Select [Generic H2] and click [Connect]:<br /> Select [Generic H2] and click [Connect]:<br />
<img class="screenshot" src="images/quickstart-3.png" alt="screenshot: Login screen" /><br /> <img class="screenshot" src="images/quickstart-3.png" alt="screenshot: login" /><br />
You are now logged in. You are now logged in.
</p> </p>
......
...@@ -43,7 +43,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -43,7 +43,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Optimize .. OR .. to IN(..) or UNION if the cost is lower </li><li>Optimize .. OR .. to IN(..) or UNION if the cost is lower
</li><li>Enable warning for 'Local variable declaration hides another field or variable'. </li><li>Enable warning for 'Local variable declaration hides another field or variable'.
</li><li>Test multi-threaded in-memory db access </li><li>Test multi-threaded in-memory db access
</li><li>MVCC: Select for update should only lock the selected rows. </li><li>MVCC: select for update should only lock the selected rows.
</li><li>Option to shutdown all the running servers (on the same VM). </li><li>Option to shutdown all the running servers (on the same VM).
</li><li>Optimize ID=? OR ID=?: convert to IN(...) </li><li>Optimize ID=? OR ID=?: convert to IN(...)
</li><li>Index organized tables CREATE TABLE...(...) ORGANIZATION INDEX (store in data file) (probably file format changes are required for rowId) </li><li>Index organized tables CREATE TABLE...(...) ORGANIZATION INDEX (store in data file) (probably file format changes are required for rowId)
...@@ -102,26 +102,26 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -102,26 +102,26 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>JSON parser and functions </li><li>JSON parser and functions
</li><li>Automatic collection of statistics (auto ANALYZE) </li><li>Automatic collection of statistics (auto ANALYZE)
</li><li>Server: client ping from time to time (to avoid timeout - is timeout a problem?) </li><li>Server: client ping from time to time (to avoid timeout - is timeout a problem?)
</li><li>Copy database: Tool with config GUI and batch mode, extensible (example: compare) </li><li>Copy database: tool with config GUI and batch mode, extensible (example: compare)
</li><li>Document, implement tool for long running transactions using user-defined compensation statements. </li><li>Document, implement tool for long running transactions using user-defined compensation statements.
</li><li>Support SET TABLE DUAL READONLY </li><li>Support SET TABLE DUAL READONLY
</li><li>GCJ: what is the state now? </li><li>GCJ: what is the state now?
</li><li>Events for: Database Startup, Connections, Login attempts, Disconnections, Prepare (after parsing), Web Server (see http://docs.openlinksw.com/virtuoso/fn_dbev_startup.html) </li><li>Events for: database Startup, Connections, Login attempts, Disconnections, Prepare (after parsing), Web Server (see http://docs.openlinksw.com/virtuoso/fn_dbev_startup.html)
</li><li>Optimization: Log compression </li><li>Optimization: log compression
</li><li>Support standard INFORMATION_SCHEMA tables, as defined in http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt; specially KEY_COLUMN_USAGE (http://dev.mysql.com/doc/refman/5.0/en/information-schema.html, http://www.xcdsql.org/Misc/INFORMATION_SCHEMA%20With%20Rolenames.gif) </li><li>Support standard INFORMATION_SCHEMA tables, as defined in http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt; specially KEY_COLUMN_USAGE (http://dev.mysql.com/doc/refman/5.0/en/information-schema.html, http://www.xcdsql.org/Misc/INFORMATION_SCHEMA%20With%20Rolenames.gif)
</li><li>Compatibility: in MySQL, HSQLDB, /0.0 is NULL; in PostgreSQL, Derby: Division by zero </li><li>Compatibility: in MySQL, HSQLDB, /0.0 is NULL; in PostgreSQL, Derby: division by zero
</li><li>Functional tables should accept parameters from other tables (see FunctionMultiReturn) SELECT * FROM TEST T, P2C(T.A, T.R) </li><li>Functional tables should accept parameters from other tables (see FunctionMultiReturn) SELECT * FROM TEST T, P2C(T.A, T.R)
</li><li>Custom class loader to reload functions on demand </li><li>Custom class loader to reload functions on demand
</li><li>Test http://mysql-je.sourceforge.net/ </li><li>Test http://mysql-je.sourceforge.net/
</li><li>Close all files when closing the database (including LOB files that are open on the client side) </li><li>Close all files when closing the database (including LOB files that are open on the client side)
</li><li>EXE file: maybe use http://jsmooth.sourceforge.net </li><li>EXE file: maybe use http://jsmooth.sourceforge.net
</li><li>Performance: Automatically build in-memory indexes if the whole table is in memory </li><li>Performance: automatically build in-memory indexes if the whole table is in memory
</li><li>H2 Console: The webclient could support more features like phpMyAdmin. </li><li>H2 Console: the webclient could support more features like phpMyAdmin.
</li><li>Use Janino to convert Java to C++ </li><li>Use Janino to convert Java to C++
</li><li>The HELP information schema can be directly exposed in the Console </li><li>The HELP information schema can be directly exposed in the Console
</li><li>Maybe use the 0x1234 notation for binary fields, see MS SQL Server </li><li>Maybe use the 0x1234 notation for binary fields, see MS SQL Server
</li><li>Support Oracle CONNECT BY in some way: http://www.adp-gmbh.ch/ora/sql/connect_by.html, http://philip.greenspun.com/sql/trees.html </li><li>Support Oracle CONNECT BY in some way: http://www.adp-gmbh.ch/ora/sql/connect_by.html, http://philip.greenspun.com/sql/trees.html
</li><li>SQL Server 2005, Oracle: Support COUNT(*) OVER(). See http://www.orafusion.com/art_anlytc.htm </li><li>SQL Server 2005, Oracle: support COUNT(*) OVER(). See http://www.orafusion.com/art_anlytc.htm
</li><li>RANK() and DENSE_RANK(), Partition using OVER() </li><li>RANK() and DENSE_RANK(), Partition using OVER()
</li><li>SQL 2003 (http://www.wiscorp.com/sql_2003_standard.zip) </li><li>SQL 2003 (http://www.wiscorp.com/sql_2003_standard.zip)
</li><li>Version column (number/sequence and timestamp based) </li><li>Version column (number/sequence and timestamp based)
...@@ -136,13 +136,13 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -136,13 +136,13 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Default date format for input and output (local date constants) </li><li>Default date format for input and output (local date constants)
</li><li>Support custom Collators </li><li>Support custom Collators
</li><li>Document ROWNUM usage for reports: SELECT ROWNUM, * FROM (subquery) </li><li>Document ROWNUM usage for reports: SELECT ROWNUM, * FROM (subquery)
</li><li>Clustering: Reads should be randomly distributed or to a designated database on RAM </li><li>Clustering: reads should be randomly distributed or to a designated database on RAM
</li><li>Clustering: When a database is back alive, automatically synchronize with the master </li><li>Clustering: when a database is back alive, automatically synchronize with the master
</li><li>Standalone tool to get relevant system properties and add it to the trace output. </li><li>Standalone tool to get relevant system properties and add it to the trace output.
</li><li>Support 'call proc(1=value)' (PostgreSQL, Oracle) </li><li>Support 'call proc(1=value)' (PostgreSQL, Oracle)
</li><li>JAMon (proxy jdbc driver) </li><li>JAMon (proxy jdbc driver)
</li><li>Console: Improve editing data (Tab, Shift-Tab, Enter, Up, Down, Shift+Del?) </li><li>Console: improve editing data (Tab, Shift-Tab, Enter, Up, Down, Shift+Del?)
</li><li>Console: Autocomplete Ctrl+Space inserts template </li><li>Console: autocomplete Ctrl+Space inserts template
</li><li>Simplify translation ('Donate a translation') </li><li>Simplify translation ('Donate a translation')
</li><li>Option to encrypt .trace.db file </li><li>Option to encrypt .trace.db file
</li><li>Write Behind Cache on SATA leads to data corruption See also http://sr5tech.com/write_back_cache_experiments.htm and http://www.jasonbrome.com/blog/archives/2004/04/03/writecache_enabled.html </li><li>Write Behind Cache on SATA leads to data corruption See also http://sr5tech.com/write_back_cache_experiments.htm and http://www.jasonbrome.com/blog/archives/2004/04/03/writecache_enabled.html
...@@ -163,7 +163,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -163,7 +163,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Table order: ALTER TABLE TEST ORDER BY NAME DESC (MySQL compatibility) </li><li>Table order: ALTER TABLE TEST ORDER BY NAME DESC (MySQL compatibility)
</li><li>Backup tool should work with other databases as well </li><li>Backup tool should work with other databases as well
</li><li>Console: -ifExists doesn't work for the console. Add a flag to disable other dbs </li><li>Console: -ifExists doesn't work for the console. Add a flag to disable other dbs
</li><li>Performance: Update in-place </li><li>Performance: update in-place
</li><li>Check if 'FSUTIL behavior set disablelastaccess 1' improves the performance (fsutil behavior query disablelastaccess) </li><li>Check if 'FSUTIL behavior set disablelastaccess 1' improves the performance (fsutil behavior query disablelastaccess)
</li><li>Java static code analysis: http://pmd.sourceforge.net/ </li><li>Java static code analysis: http://pmd.sourceforge.net/
</li><li>Java static code analysis: http://www.eclipse.org/tptp/ </li><li>Java static code analysis: http://www.eclipse.org/tptp/
...@@ -220,7 +220,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -220,7 +220,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Compatibility with Derby: VALUES(1), (2); SELECT * FROM (VALUES (1), (2)) AS myTable(c1) </li><li>Compatibility with Derby: VALUES(1), (2); SELECT * FROM (VALUES (1), (2)) AS myTable(c1)
</li><li>Compatibility: # is the start of a single line comment (MySQL) but date quote (Access). Mode specific </li><li>Compatibility: # is the start of a single line comment (MySQL) but date quote (Access). Mode specific
</li><li>Run benchmarks with JDK 1.5, JDK 1.6, java -server </li><li>Run benchmarks with JDK 1.5, JDK 1.6, java -server
</li><li>Optimizations: Faster hash function for strings, byte arrays </li><li>Optimizations: faster hash function for strings, byte arrays
</li><li>DatabaseEventListener: callback for all operations (including expected time, RUNSCRIPT) and cancel functionality </li><li>DatabaseEventListener: callback for all operations (including expected time, RUNSCRIPT) and cancel functionality
</li><li>H2 Console / large result sets: use 'streaming' instead of building the page in-memory </li><li>H2 Console / large result sets: use 'streaming' instead of building the page in-memory
</li><li>Benchmark: add a graph to show how databases scale (performance/database size) </li><li>Benchmark: add a graph to show how databases scale (performance/database size)
...@@ -238,7 +238,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -238,7 +238,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Ability to resize the cache array when resizing the cache </li><li>Ability to resize the cache array when resizing the cache
</li><li>Time based cache writing (one second after writing the log) </li><li>Time based cache writing (one second after writing the log)
</li><li>Check state of H2 driver for DDLUtils: https://issues.apache.org/jira/browse/DDLUTILS-185 </li><li>Check state of H2 driver for DDLUtils: https://issues.apache.org/jira/browse/DDLUTILS-185
</li><li>Support JMX: Create an MBean for each database and server (support JConsole). </li><li>Support JMX: create an MBean for each database and server (support JConsole).
See http://thedevcloud.blogspot.com/2008/10/displaying-hsql-database-manager-in.html See http://thedevcloud.blogspot.com/2008/10/displaying-hsql-database-manager-in.html
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer() http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer()
http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html
...@@ -246,7 +246,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -246,7 +246,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Compatibility: add a role DBA (like ADMIN). </li><li>Compatibility: add a role DBA (like ADMIN).
</li><li>Better support multiple processors for in-memory databases. </li><li>Better support multiple processors for in-memory databases.
</li><li>Access rights: remember the owner of an object. COMMENT: allow owner of object to change it. </li><li>Access rights: remember the owner of an object. COMMENT: allow owner of object to change it.
</li><li>Access rights: Finer grained access control (grant access for specific functions) </li><li>Access rights: finer grained access control (grant access for specific functions)
</li><li>Support N'text' </li><li>Support N'text'
</li><li>Support SCOPE_IDENTITY() to avoid problems when inserting rows in a trigger </li><li>Support SCOPE_IDENTITY() to avoid problems when inserting rows in a trigger
</li><li>Set a connection read only (Connection.setReadOnly) </li><li>Set a connection read only (Connection.setReadOnly)
...@@ -264,7 +264,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -264,7 +264,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Optimize SELECT MIN(ID), MAX(ID), COUNT(*) FROM TEST WHERE ID BETWEEN 100 AND 200 </li><li>Optimize SELECT MIN(ID), MAX(ID), COUNT(*) FROM TEST WHERE ID BETWEEN 100 AND 200
</li><li>Support Oracle functions: TRUNC, NVL2, TO_CHAR, TO_DATE, TO_NUMBER </li><li>Support Oracle functions: TRUNC, NVL2, TO_CHAR, TO_DATE, TO_NUMBER
</li><li>Sequence: PostgreSQL compatibility (rename, create) (http://www.postgresql.org/docs/8.2/static/sql-altersequence.html) </li><li>Sequence: PostgreSQL compatibility (rename, create) (http://www.postgresql.org/docs/8.2/static/sql-altersequence.html)
</li><li>DISTINCT: Support large result sets by sorting on all columns (additionally) and then removing duplicates. </li><li>DISTINCT: support large result sets by sorting on all columns (additionally) and then removing duplicates.
</li><li>File system that writes to two file systems (replicating file system) </li><li>File system that writes to two file systems (replicating file system)
</li><li>File system with a background writer thread; test if this is faster </li><li>File system with a background writer thread; test if this is faster
</li><li>FTP access to a database (.csv for a table, a directory for a schema, a file for a lob, a script.sql file). </li><li>FTP access to a database (.csv for a table, a directory for a schema, a file for a lob, a script.sql file).
...@@ -273,7 +273,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -273,7 +273,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Optimization: don't lock when the database is read-only </li><li>Optimization: don't lock when the database is read-only
</li><li>Integrate spatial functions from http://geosysin.iict.ch/irstv-trac/wiki/H2spatial/Download </li><li>Integrate spatial functions from http://geosysin.iict.ch/irstv-trac/wiki/H2spatial/Download
</li><li>Support COSH, SINH, and TANH functions </li><li>Support COSH, SINH, and TANH functions
</li><li>FTP Server: Implement SFTP / FTPS </li><li>FTP Server: implement SFTP / FTPS
</li><li>Native search: support "phrase search", wildcard search (* and ?), case-insensitive search, boolean operators, and grouping </li><li>Native search: support "phrase search", wildcard search (* and ?), case-insensitive search, boolean operators, and grouping
</li><li>Improve documentation of access rights </li><li>Improve documentation of access rights
</li><li>Support ENUM data type (see MySQL, PostgreSQL, MS SQL Server, maybe others) </li><li>Support ENUM data type (see MySQL, PostgreSQL, MS SQL Server, maybe others)
...@@ -294,10 +294,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -294,10 +294,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Web site design: http://www.igniterealtime.org/projects/openfire/index.jsp </li><li>Web site design: http://www.igniterealtime.org/projects/openfire/index.jsp
</li><li>HSQLDB compatibility: Openfire server uses: CREATE SCHEMA PUBLIC AUTHORIZATION DBA; </li><li>HSQLDB compatibility: Openfire server uses: CREATE SCHEMA PUBLIC AUTHORIZATION DBA;
CREATE USER SA PASSWORD ""; GRANT DBA TO SA; SET SCHEMA PUBLIC CREATE USER SA PASSWORD ""; GRANT DBA TO SA; SET SCHEMA PUBLIC
</li><li>Web site: Rename Performance to Comparison [/Compatibility],
move Comparison to Other Database Engines to Comparison,
move Products that Work with H2 to Comparison,
move Performance Tuning to Advanced Topics
</li><li>Translation: use ${.} in help.csv </li><li>Translation: use ${.} in help.csv
</li><li>Translated .pdf </li><li>Translated .pdf
</li><li>Cluster: hot deploy (adding a node at runtime) </li><li>Cluster: hot deploy (adding a node at runtime)
...@@ -341,7 +337,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -341,7 +337,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Oracle: support DECODE method (convert to CASE WHEN). </li><li>Oracle: support DECODE method (convert to CASE WHEN).
</li><li>Support large databases: split LOB (BLOB, CLOB) to multiple directories / disks (similar to tablespaces). </li><li>Support large databases: split LOB (BLOB, CLOB) to multiple directories / disks (similar to tablespaces).
</li><li>Support to assign a primary key index a user defined name. </li><li>Support to assign a primary key index a user defined name.
</li><li>Cluster: Add feature to make sure cluster nodes can not get out of sync (for example by stopping one process). </li><li>Cluster: add feature to make sure cluster nodes can not get out of sync (for example by stopping one process).
</li><li>H2 Console: support configuration option for fixed width (monospace) font. </li><li>H2 Console: support configuration option for fixed width (monospace) font.
</li><li>Native fulltext search: support analyzers (specially for Chinese, Japanese). </li><li>Native fulltext search: support analyzers (specially for Chinese, Japanese).
</li><li>Automatically compact databases from time to time (as a background process). </li><li>Automatically compact databases from time to time (as a background process).
...@@ -353,8 +349,8 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -353,8 +349,8 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>executeBatch: option to stop at the first failed statement. </li><li>executeBatch: option to stop at the first failed statement.
</li><li>Implement OLAP features as described here: http://www.devx.com/getHelpOn/10MinuteSolution/16573/0/page/5 </li><li>Implement OLAP features as described here: http://www.devx.com/getHelpOn/10MinuteSolution/16573/0/page/5
</li><li>Support Oracle ROWID (unique identifier for each row). </li><li>Support Oracle ROWID (unique identifier for each row).
</li><li>Server mode: Improve performance for batch updates. </li><li>Server mode: improve performance for batch updates.
</li><li>Applets: Support read-only databases in a zip file (accessed as a resource). </li><li>Applets: support read-only databases in a zip file (accessed as a resource).
</li><li>Long running queries / errors / trace system table. </li><li>Long running queries / errors / trace system table.
</li><li>H2 Console should support JaQu directly. </li><li>H2 Console should support JaQu directly.
</li><li>H2 Console: support single file upload and directory download (optional). </li><li>H2 Console: support single file upload and directory download (optional).
...@@ -366,18 +362,18 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -366,18 +362,18 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Use http://recaptcha.net somehow to secure the Google Group. </li><li>Use http://recaptcha.net somehow to secure the Google Group.
</li><li>Support DELETE with TOP or LIMIT. See also: http://dev.mysql.com/doc/refman/5.1/de/delete.html </li><li>Support DELETE with TOP or LIMIT. See also: http://dev.mysql.com/doc/refman/5.1/de/delete.html
</li><li>Change the default for NULL || 'x' to return NULL </li><li>Change the default for NULL || 'x' to return NULL
</li><li>ANALYZE: Use a bloom filter for each indexed column to estimate count of distinct values. </li><li>ANALYZE: use a bloom filter for each indexed column to estimate count of distinct values.
</li><li>ANALYZE: For unique indexes that allow null, count the number of null. </li><li>ANALYZE: for unique indexes that allow null, count the number of null.
</li><li>AUTO_SERVER: support changing IP addresses (disable a network while the database is open). </li><li>AUTO_SERVER: support changing IP addresses (disable a network while the database is open).
</li><li>Avoid using java.util.Calendar internally because it's slow, complicated, and seems to be buggy. </li><li>Avoid using java.util.Calendar internally because it's slow, complicated, and seems to be buggy.
</li><li>Support TRUNCATE .. CASCADE like PostgreSQL. </li><li>Support TRUNCATE .. CASCADE like PostgreSQL.
</li><li>Support opening a database that is in the classpath, maybe using a new file system. </li><li>Support opening a database that is in the classpath, maybe using a new file system.
</li><li>Fulltext search: lazy result generation using SimpleRowSource. </li><li>Fulltext search: lazy result generation using SimpleRowSource.
</li><li>Support transformation to join for user defined functions, as for IN(SELECT...). </li><li>Support transformation to join for user defined functions, as for IN(SELECT...).
</li><li>Fulltext search: Support alternative syntax: WHERE FTL_CONTAINS(name, 'hello'). </li><li>Fulltext search: support alternative syntax: WHERE FTL_CONTAINS(name, 'hello').
</li><li>MySQL compatibility: support REPLACE, see http://dev.mysql.com/doc/refman/5.1/de/replace.html </li><li>MySQL compatibility: support REPLACE, see http://dev.mysql.com/doc/refman/5.1/de/replace.html
</li><li>MySQL compatibility: support INSERT INTO table SET column1 = value1, column2 = value2 </li><li>MySQL compatibility: support INSERT INTO table SET column1 = value1, column2 = value2
</li><li>Docs: Add a one line description for each functions and SQL statements at the top (in the link section). </li><li>Docs: add a one line description for each functions and SQL statements at the top (in the link section).
</li><li>Javadoc search: weight for titles should be higher ('random' should list Functions as the best match). </li><li>Javadoc search: weight for titles should be higher ('random' should list Functions as the best match).
</li><li>Replace information_schema tables with regular tables that are automatically re-built when needed. Use indexes. </li><li>Replace information_schema tables with regular tables that are automatically re-built when needed. Use indexes.
</li><li>Support a special trigger on all tables. </li><li>Support a special trigger on all tables.
...@@ -431,6 +427,8 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -431,6 +427,8 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>HSQLDB compatibility: CREATE FUNCTION (maybe using a Function interface). </li><li>HSQLDB compatibility: CREATE FUNCTION (maybe using a Function interface).
</li><li>HSQLDB compatibility: support CALL "java.lang.Math.sqrt"(2.0) </li><li>HSQLDB compatibility: support CALL "java.lang.Math.sqrt"(2.0)
</li><li>Support comma as the decimal separator in the CSV tool. </li><li>Support comma as the decimal separator in the CSV tool.
</li><li>Compatibility: Java functions with SQLJ Part1 http://www.acm.org/sigmod/record/issues/9912/standards.pdf.gz
</li><li>Compatibility: Java functions with SQL/PSM (Persistent Stored Modules) - need to find the documentation.
</li></ul> </li></ul>
<h2>Not Planned</h2> <h2>Not Planned</h2>
......
...@@ -185,7 +185,7 @@ by clicking on the message. ...@@ -185,7 +185,7 @@ by clicking on the message.
<h3>Adding Database Drivers</h3> <h3>Adding Database Drivers</h3>
<p> <p>
Additional database drivers can be registered by adding the Jar file location of the driver to the environment Additional database drivers can be registered by adding the Jar file location of the driver to the environment
variables H2DRIVERS or CLASSPATH. Example (Windows): To add the database driver library variables H2DRIVERS or CLASSPATH. Example (Windows): to add the database driver library
C:\Programs\hsqldb\lib\hsqldb.jar, set the environment variable H2DRIVERS to C:\Programs\hsqldb\lib\hsqldb.jar, set the environment variable H2DRIVERS to
C:\Programs\hsqldb\lib\hsqldb.jar. C:\Programs\hsqldb\lib\hsqldb.jar.
</p><p> </p><p>
......
...@@ -125,7 +125,7 @@ You can then access the table in the usual way. Whenever the linked table is acc ...@@ -125,7 +125,7 @@ You can then access the table in the usual way. Whenever the linked table is acc
To view the statements that are executed against the target table, set the trace level to 3. To view the statements that are executed against the target table, set the trace level to 3.
@advanced_1042_p @advanced_1042_p
There is a restriction: When inserting into a linked table, and when updating a linked table, NULL and values that are not set are both inserted as NULL. This may not have the desired effect if the default value for this column in the target table is not NULL. There is a restriction: when inserting into a linked table, and when updating a linked table, NULL and values that are not set are both inserted as NULL. This may not have the desired effect if the default value for this column in the target table is not NULL.
@advanced_1043_p @advanced_1043_p
If multiple linked tables point to the same database (using the same database URL), the connection is shared. To disable this, set the system property h2.shareLinkedConnections to false. If multiple linked tables point to the same database (using the same database URL), the connection is shared. To disable this, set the system property h2.shareLinkedConnections to false.
...@@ -566,16 +566,16 @@ ACID ...@@ -566,16 +566,16 @@ ACID
In the database world, ACID stands for: In the database world, ACID stands for:
@advanced_1189_li @advanced_1189_li
Atomicity: Transactions must be atomic, meaning either all tasks are performed or none. Atomicity: transactions must be atomic, meaning either all tasks are performed or none.
@advanced_1190_li @advanced_1190_li
Consistency: All operations must comply with the defined constraints. Consistency: all operations must comply with the defined constraints.
@advanced_1191_li @advanced_1191_li
Isolation: Transactions must be isolated from each other. Isolation: transactions must be isolated from each other.
@advanced_1192_li @advanced_1192_li
Durability: Committed transaction will not be lost. Durability: committed transaction will not be lost.
@advanced_1193_h3 @advanced_1193_h3
Atomicity Atomicity
...@@ -614,10 +614,10 @@ Ways to (Not) Achieve Durability ...@@ -614,10 +614,10 @@ Ways to (Not) Achieve Durability
Making sure that committed transactions are not lost is more complicated than it seems first. To guarantee complete durability, a database must ensure that the log record is on the hard drive before the commit call returns. To do that, databases use different methods. One is to use the 'synchronous write' file access mode. In Java, RandomAccessFile supports the modes "rws" and "rwd": Making sure that committed transactions are not lost is more complicated than it seems first. To guarantee complete durability, a database must ensure that the log record is on the hard drive before the commit call returns. To do that, databases use different methods. One is to use the 'synchronous write' file access mode. In Java, RandomAccessFile supports the modes "rws" and "rwd":
@advanced_1205_li @advanced_1205_li
rwd: Every update to the file's content is written synchronously to the underlying storage device. rwd: every update to the file's content is written synchronously to the underlying storage device.
@advanced_1206_li @advanced_1206_li
rws: In addition to rwd, every update to the metadata is written synchronously. rws: in addition to rwd, every update to the metadata is written synchronously.
@advanced_1207_p @advanced_1207_p
A test (org.h2.test.poweroff.TestWrite) with one of those modes achieves around 50 thousand write operations per second. Even when the operating system write buffer is disabled, the write rate is around 50 thousand operations per second. This feature does not force changes to disk because it does not flush all buffers. The test updates the same byte in the file again and again. If the hard drive was able to write at this rate, then the disk would need to make at least 50 thousand revolutions per second, or 3 million RPM (revolutions per minute). There are no such hard drives. The hard drive used for the test is about 7200 RPM, or about 120 revolutions per second. There is an overhead, so the maximum write rate must be lower than that. A test (org.h2.test.poweroff.TestWrite) with one of those modes achieves around 50 thousand write operations per second. Even when the operating system write buffer is disabled, the write rate is around 50 thousand operations per second. This feature does not force changes to disk because it does not flush all buffers. The test updates the same byte in the file again and again. If the hard drive was able to write at this rate, then the disk would need to make at least 50 thousand revolutions per second, or 3 million RPM (revolutions per minute). There are no such hard drives. The hard drive used for the test is about 7200 RPM, or about 120 revolutions per second. There is an overhead, so the maximum write rate must be lower than that.
...@@ -788,7 +788,7 @@ When a new database file is created, a new cryptographically secure random salt ...@@ -788,7 +788,7 @@ When a new database file is created, a new cryptographically secure random salt
The resulting hash value is used as the key for the block cipher algorithm (AES-128 or XTEA with 32 rounds). Then, an initialization vector (IV) key is calculated by hashing the key again using SHA-256. This is to make sure the IV is unknown to the attacker. The reason for using a secret IV is to protect against watermark attacks. The resulting hash value is used as the key for the block cipher algorithm (AES-128 or XTEA with 32 rounds). Then, an initialization vector (IV) key is calculated by hashing the key again using SHA-256. This is to make sure the IV is unknown to the attacker. The reason for using a secret IV is to protect against watermark attacks.
@advanced_1263_p @advanced_1263_p
Before saving a block of data (each block is 8 bytes long), the following operations are executed: First, the IV is calculated by encrypting the block number with the IV key (using the same block cipher algorithm). This IV is combined with the plain text using XOR. The resulting data is encrypted using the AES-128 or XTEA algorithm. Before saving a block of data (each block is 8 bytes long), the following operations are executed: first, the IV is calculated by encrypting the block number with the IV key (using the same block cipher algorithm). This IV is combined with the plain text using XOR. The resulting data is encrypted using the AES-128 or XTEA algorithm.
@advanced_1264_p @advanced_1264_p
When decrypting, the operation is done in reverse. First, the block is decrypted using the key, and then the IV is calculated combined with the decrypted text using XOR. When decrypting, the operation is done in reverse. First, the block is decrypted using the key, and then the IV is calculated combined with the decrypted text using XOR.
...@@ -839,7 +839,7 @@ This database supports the UUIDs. Also supported is a function to create new UUI ...@@ -839,7 +839,7 @@ This database supports the UUIDs. Also supported is a function to create new UUI
Some values are: Some values are:
@advanced_1280_p @advanced_1280_p
To help non-mathematicians understand what those numbers mean, here a comparison: One's annual risk of being hit by a meteorite is estimated to be one chance in 17 billion, that means the probability is about 0.000'000'000'06. To help non-mathematicians understand what those numbers mean, here a comparison: one's annual risk of being hit by a meteorite is estimated to be one chance in 17 billion, that means the probability is about 0.000'000'000'06.
@advanced_1281_h2 @advanced_1281_h2
Settings Read from System Properties Settings Read from System Properties
...@@ -866,7 +866,7 @@ Limitations ...@@ -866,7 +866,7 @@ Limitations
This database has the following known limitations: This database has the following known limitations:
@advanced_1289_li @advanced_1289_li
The maximum file size is currently 256 GB for the data, and 256 GB for the index. This number is excluding BLOB and CLOB data: Every CLOB or BLOB can be up to 256 GB as well. The maximum file size is currently 256 GB for the data, and 256 GB for the index. This number is excluding BLOB and CLOB data: every CLOB or BLOB can be up to 256 GB as well.
@advanced_1290_li @advanced_1290_li
The maximum file size for FAT or FAT32 file systems is 4 GB. That means when using FAT or FAT32, the limit is 4 GB for the data. This is the limitation of the file system. The database does provide a workaround for this problem, it is to use the file name prefix 'split:'. In that case files are split into files of 1 GB by default. An example database URL is: <code>jdbc:h2:split:~/test</code> . The maximum file size for FAT or FAT32 file systems is 4 GB. That means when using FAT or FAT32, the limit is 4 GB for the data. This is the limitation of the file system. The database does provide a workaround for this problem, it is to use the file name prefix 'split:'. In that case files are split into files of 1 GB by default. An example database URL is: <code>jdbc:h2:split:~/test</code> .
...@@ -1064,16 +1064,16 @@ Build Targets ...@@ -1064,16 +1064,16 @@ Build Targets
The build system can generate smaller jar files as well. The following targets are currently supported: The build system can generate smaller jar files as well. The following targets are currently supported:
@build_1032_li @build_1032_li
jarClient: Create the h2client.jar. This only contains the JDBC client. jarClient creates the h2client.jar. This only contains the JDBC client.
@build_1033_li @build_1033_li
jarSmall: Create the file h2small.jar. This only contains the embedded database. Debug information is disabled. jarSmall creates the file h2small.jar. This only contains the embedded database. Debug information is disabled.
@build_1034_li @build_1034_li
jarJaqu: Create the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu. jarJaqu creates the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu.
@build_1035_li @build_1035_li
javadocImpl: Create the Javadocs of the implementation. javadocImpl creates the Javadocs of the implementation.
@build_1036_p @build_1036_p
To create the h2client.jar file, go to the directory h2 and execute the following command: To create the h2client.jar file, go to the directory h2 and execute the following command:
...@@ -1136,7 +1136,7 @@ Please provide test cases and integrate them into the test suite. For Java leve ...@@ -1136,7 +1136,7 @@ Please provide test cases and integrate them into the test suite. For Java leve
The test cases should cover at least 90% of the changed and new code; use a code coverage tool to verify that (see above). or use the build target 'coverage'. The test cases should cover at least 90% of the changed and new code; use a code coverage tool to verify that (see above). or use the build target 'coverage'.
@build_1056_li @build_1056_li
Verify that you did not break other features: Run the test cases by executing <code>build test</code> . Verify that you did not break other features: run the test cases by executing <code>build test</code> .
@build_1057_li @build_1057_li
Provide end user documentation if required ( <code>src/docsrc/html/*</code> ). Provide end user documentation if required ( <code>src/docsrc/html/*</code> ).
...@@ -1280,7 +1280,7 @@ Version 1.1.114 (2009-06-01) ...@@ -1280,7 +1280,7 @@ Version 1.1.114 (2009-06-01)
ResultSetMetaData.getColumnClassName returned the wrong class for CLOB and BLOB columns. ResultSetMetaData.getColumnClassName returned the wrong class for CLOB and BLOB columns.
@changelog_1034_li @changelog_1034_li
Fulltext search: Data is no longer deleted and re-inserted if the indexed columns didn't change. Fulltext search: data is no longer deleted and re-inserted if the indexed columns didn't change.
@changelog_1035_li @changelog_1035_li
In some situations, an ArrayIndexOutOfBoundsException was thrown when adding rows. This was caused by a bug in the b-tree code. In some situations, an ArrayIndexOutOfBoundsException was thrown when adding rows. This was caused by a bug in the b-tree code.
...@@ -1313,7 +1313,7 @@ Identifiers with a digit and then a dollar sign didn't work. Example: A1$B. ...@@ -1313,7 +1313,7 @@ Identifiers with a digit and then a dollar sign didn't work. Example: A1$B.
MS SQL Server compatibility: support for linked tables with NVARCHAR, NCHAR, NCLOB, and LONGNVARCHAR. MS SQL Server compatibility: support for linked tables with NVARCHAR, NCHAR, NCLOB, and LONGNVARCHAR.
@changelog_1045_li @changelog_1045_li
Android: Workaround for a problem when using read-only databases in zip files (skip seems to be implemented incorrectly on the Android system). Android: workaround for a problem when using read-only databases in zip files (skip seems to be implemented incorrectly on the Android system).
@changelog_1046_li @changelog_1046_li
Calling execute() or prepareStatement() with null as the SQL statement now throws an exception. Calling execute() or prepareStatement() with null as the SQL statement now throws an exception.
...@@ -1334,7 +1334,7 @@ Version 1.1.112 (2009-05-01) ...@@ -1334,7 +1334,7 @@ Version 1.1.112 (2009-05-01)
JdbcPreparedStatement.toString() could throw a NullPointerException. JdbcPreparedStatement.toString() could throw a NullPointerException.
@changelog_1052_li @changelog_1052_li
EclipseLink: Added H2Platform.supportsIdentity(). EclipseLink: added H2Platform.supportsIdentity().
@changelog_1053_li @changelog_1053_li
Connection pool: the default login timeout is now 5 minutes. Connection pool: the default login timeout is now 5 minutes.
...@@ -1550,7 +1550,7 @@ Improved exception message when connecting to a just started server fails. ...@@ -1550,7 +1550,7 @@ Improved exception message when connecting to a just started server fails.
Connection.isValid is a bit faster. Connection.isValid is a bit faster.
@changelog_1124_li @changelog_1124_li
H2 Console: The autocomplete feature has been improved a bit. It can now better parse conditions. H2 Console: the autocomplete feature has been improved a bit. It can now better parse conditions.
@changelog_1125_li @changelog_1125_li
When restarting a web application in Tomcat, an exception was thrown sometimes. In most cases this was a NullPointerException. A workaround in H2 has been implemented. The root cause of the problem is now documented in the FAQ: Tomcat sets all static fields (final or non-final) to null when unloading a web application. A workaround is to put the h2.jar in the lib directory, or set the system property org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES to false. When restarting a web application in Tomcat, an exception was thrown sometimes. In most cases this was a NullPointerException. A workaround in H2 has been implemented. The root cause of the problem is now documented in the FAQ: Tomcat sets all static fields (final or non-final) to null when unloading a web application. A workaround is to put the h2.jar in the lib directory, or set the system property org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES to false.
...@@ -1580,13 +1580,13 @@ Version 1.1.106 (2009-01-04) ...@@ -1580,13 +1580,13 @@ Version 1.1.106 (2009-01-04)
Statement.setQueryTimeout did not work correctly for some statements. Statement.setQueryTimeout did not work correctly for some statements.
@changelog_1134_li @changelog_1134_li
CREATE DOMAIN: Built-in data types can now only be changed if no tables exist. CREATE DOMAIN: built-in data types can now only be changed if no tables exist.
@changelog_1135_li @changelog_1135_li
Linked tables: a workaround for Oracle DATE columns has been implemented. Linked tables: a workaround for Oracle DATE columns has been implemented.
@changelog_1136_li @changelog_1136_li
DatabaseMetaData.getPrimaryKeys: The column PK_NAME now contains the constraint name instead of the index name (compatibility for PostgreSQL and Derby). DatabaseMetaData.getPrimaryKeys: the column PK_NAME now contains the constraint name instead of the index name (compatibility for PostgreSQL and Derby).
@changelog_1137_li @changelog_1137_li
Using IN(..) inside a IN(SELECT..) did not always work. Using IN(..) inside a IN(SELECT..) did not always work.
...@@ -1604,7 +1604,7 @@ The license change a bit: so far the license was modified to say 'Swiss law'. T ...@@ -1604,7 +1604,7 @@ The license change a bit: so far the license was modified to say 'Swiss law'. T
Constraints for local temporary tables now session scoped. So far they were global. Thanks a lot to Eric Faulhaber for finding and fixing this problem! Constraints for local temporary tables now session scoped. So far they were global. Thanks a lot to Eric Faulhaber for finding and fixing this problem!
@changelog_1142_li @changelog_1142_li
When using the auto-server mode, and if the lock file was modified in the future, the wrong exception was thrown ('Connection is broken' instead of 'Error opening database: Lock file modified in the future'). When using the auto-server mode, and if the lock file was modified in the future, the wrong exception was thrown ('Connection is broken' instead of 'Error opening database: lock file modified in the future').
@changelog_1143_h2 @changelog_1143_h2
Version 1.1.105 (2008-12-19) Version 1.1.105 (2008-12-19)
...@@ -1652,7 +1652,7 @@ New meta data column INFORMATION_SCHEMA.TABLES.LAST_MODIFICATION to get the tab ...@@ -1652,7 +1652,7 @@ New meta data column INFORMATION_SCHEMA.TABLES.LAST_MODIFICATION to get the tab
Shell: line comments didn't work correctly. Shell: line comments didn't work correctly.
@changelog_1158_li @changelog_1158_li
H2 Console: Columns are now listed for up to 500 tables instead of 100. H2 Console: columns are now listed for up to 500 tables instead of 100.
@changelog_1159_li @changelog_1159_li
H2 Console: Cmd+Enter executes the current statement, Alt+Space for autocomplete. H2 Console: Cmd+Enter executes the current statement, Alt+Space for autocomplete.
...@@ -1757,7 +1757,7 @@ The Japanese translation has been completed by Masahiro Ikemoto. Thanks a lot! ...@@ -1757,7 +1757,7 @@ The Japanese translation has been completed by Masahiro Ikemoto. Thanks a lot!
Improved PostgreSQL compatibility for NEXTVAL and CURRVAL. Improved PostgreSQL compatibility for NEXTVAL and CURRVAL.
@changelog_1193_li @changelog_1193_li
Less heap memory is needed when multiple databases are open at the same time: The memory reserve (used to rollback after out of memory) is now global and no longer allocated for each database separately. Less heap memory is needed when multiple databases are open at the same time: the memory reserve (used to rollback after out of memory) is now global and no longer allocated for each database separately.
@changelog_1194_li @changelog_1194_li
New system property h2.browser to set the browser to use. New system property h2.browser to set the browser to use.
...@@ -2093,7 +2093,7 @@ There is a problem with Hibernate when using Boolean columns. A patch for Hiber ...@@ -2093,7 +2093,7 @@ There is a problem with Hibernate when using Boolean columns. A patch for Hiber
ORDER BY on tableName.columnName didn't work correctly if the column name was also used as an alias. ORDER BY on tableName.columnName didn't work correctly if the column name was also used as an alias.
@changelog_1305_li @changelog_1305_li
H2 Console: The progress display when opening a database has been improved. H2 Console: the progress display when opening a database has been improved.
@changelog_1306_li @changelog_1306_li
The error message when the server doesn't start has been improved. The error message when the server doesn't start has been improved.
...@@ -3653,7 +3653,7 @@ The number of seconds until a lock timeout exception is thrown can be set separa ...@@ -3653,7 +3653,7 @@ The number of seconds until a lock timeout exception is thrown can be set separa
Database File Layout Database File Layout
@features_1423_p @features_1423_p
There are a number of files created for persistent databases. Unlike some other databases, not every table and/or index is stored in its own file. Instead, usually only the following files are created: A data file, an index file, a log file, and a database lock file (exists only while the database is in use). In addition to that, a file is created for each large object (CLOB/BLOB) larger than a certain size, and temporary files for large result sets. If the database trace option is enabled, trace files are created. The following files can be created by the database: There are a number of files created for persistent databases. Unlike some other databases, not every table and/or index is stored in its own file. Instead, usually only the following files are created: a data file, an index file, a log file, and a database lock file (exists only while the database is in use). In addition to that, a file is created for each large object (CLOB/BLOB) larger than a certain size, and temporary files for large result sets. If the database trace option is enabled, trace files are created. The following files can be created by the database:
@features_1424_th @features_1424_th
File Name File Name
...@@ -3950,7 +3950,7 @@ When using this mode, the first connection to the database is made in embedded m ...@@ -3950,7 +3950,7 @@ When using this mode, the first connection to the database is made in embedded m
The application that opens the first connection to the database uses the embedded mode, which is faster than the server mode. Therefore the main application should open the database first if possible. The first connection automatically starts a server on a random port. This server allows remote connections, however only to this database (to ensure that, the client reads .lock.db file and sends the the random key that is stored there to the server). When the first connection is closed, the server stops. If other (remote) connections are still open, one of them will then start a server (auto-reconnect is enabled automatically). The application that opens the first connection to the database uses the embedded mode, which is faster than the server mode. Therefore the main application should open the database first if possible. The first connection automatically starts a server on a random port. This server allows remote connections, however only to this database (to ensure that, the client reads .lock.db file and sends the the random key that is stored there to the server). When the first connection is closed, the server stops. If other (remote) connections are still open, one of them will then start a server (auto-reconnect is enabled automatically).
@features_1522_p @features_1522_p
This mode has three disadvantages: All processes need to have access to the database files. Then, if the first connection is closed (the connection that started the server), open transactions of other connections will be rolled back. Also, explicit client/server connections (using jdbc:h2:tcp:// or ssl://) are not supported. This mode has three disadvantages: all processes need to have access to the database files. Then, if the first connection is closed (the connection that started the server), open transactions of other connections will be rolled back. Also, explicit client/server connections (using jdbc:h2:tcp:// or ssl://) are not supported.
@features_1523_p @features_1523_p
Here is an example how to use this mode. Application 1 and 2 are not necessarily started on the same computer, but they need to have access to the database files. Application 1 and 2 are typically two different processes (however they could run within the same process). Here is an example how to use this mode. Application 1 and 2 are not necessarily started on the same computer, but they need to have access to the database files. Application 1 and 2 are typically two different processes (however they could run within the same process).
...@@ -4025,7 +4025,7 @@ Changing the log mechanism is not possible after the database is open, that mean ...@@ -4025,7 +4025,7 @@ Changing the log mechanism is not possible after the database is open, that mean
Read Only Databases Read Only Databases
@features_1547_p @features_1547_p
If the database files are read-only, then the database is read-only as well. It is not possible to create new tables, add or modify data in this database. Only SELECT and CALL statements are allowed. To create a read-only database, close the database so that the log file gets smaller. Do not delete the log file. Then, make the database files read-only using the operating system. When you open the database now, it is read-only. There are two ways an application can find out whether database is read-only: By calling Connection.isReadOnly() or by executing the SQL statement CALL READONLY(). If the database files are read-only, then the database is read-only as well. It is not possible to create new tables, add or modify data in this database. Only SELECT and CALL statements are allowed. To create a read-only database, close the database so that the log file gets smaller. Do not delete the log file. Then, make the database files read-only using the operating system. When you open the database now, it is read-only. There are two ways an application can find out whether database is read-only: by calling Connection.isReadOnly() or by executing the SQL statement CALL READONLY().
@features_1548_h2 @features_1548_h2
Read Only Databases in Zip or Jar File Read Only Databases in Zip or Jar File
...@@ -4154,7 +4154,7 @@ A function can create a result set using the SimpleResultSet tool: ...@@ -4154,7 +4154,7 @@ A function can create a result set using the SimpleResultSet tool:
Using a Function as a Table Using a Function as a Table
@features_1590_p @features_1590_p
A function that returns a result set can be used like a table. However, in this case the function is called at least twice: First while parsing the statement to collect the column names (with parameters set to null where not known at compile time). And then, while executing the statement to get the data (maybe multiple times if this is a join). If the function is called just to get the column list, the URL of the connection passed to the function is <code>jdbc:columnlist:connection</code> . Otherwise, the URL of the connection is <code>jdbc:default:connection</code> . A function that returns a result set can be used like a table. However, in this case the function is called at least twice: first while parsing the statement to collect the column names (with parameters set to null where not known at compile time). And then, while executing the statement to get the data (maybe multiple times if this is a join). If the function is called just to get the column list, the URL of the connection passed to the function is <code>jdbc:columnlist:connection</code> . Otherwise, the URL of the connection is <code>jdbc:default:connection</code> .
@features_1591_h2 @features_1591_h2
Triggers Triggers
...@@ -4364,7 +4364,7 @@ Some people think that Java is still too slow for low level operations, but this ...@@ -4364,7 +4364,7 @@ Some people think that Java is still too slow for low level operations, but this
A lot of features are already built in (for example Unicode, network libraries). It is very easy to write secure code because buffer overflows can not occur. Some features such as the reflection mechanism can be used for randomized testing. A lot of features are already built in (for example Unicode, network libraries). It is very easy to write secure code because buffer overflows can not occur. Some features such as the reflection mechanism can be used for randomized testing.
@history_1021_p @history_1021_p
Java is also future proof: A lot of companies support Java, and it is now open source. Java is also future proof: a lot of companies support Java, and it is now open source.
@history_1022_p @history_1022_p
This software does not rely on many Java libraries or other software, to increase the portability and ease of use, and for performance reasons. For example, the encryption algorithms and many library functions are implemented in the database instead of using the existing libraries. Libraries that are not available in open source Java implementations (such as Swing) are not used or only used for specific features. This software does not rely on many Java libraries or other software, to increase the portability and ease of use, and for performance reasons. For example, the encryption algorithms and many library functions are implemented in the database instead of using the existing libraries. Libraries that are not available in open source Java implementations (such as Swing) are not used or only used for specific features.
...@@ -4562,7 +4562,7 @@ Primitive types (eg. boolean, int, long, double) are not supported. Use Boolean, ...@@ -4562,7 +4562,7 @@ Primitive types (eg. boolean, int, long, double) are not supported. Use Boolean,
Why in Java? Why in Java?
@jaqu_1011_p @jaqu_1011_p
Most people use Java in their application. Mixing Java and another language (for example Scala or Groovy) in the same application is complicated: You would need to split the application and database code. Most people use Java in their application. Mixing Java and another language (for example Scala or Groovy) in the same application is complicated: you would need to split the application and database code.
@jaqu_1012_h2 @jaqu_1012_h2
Current State Current State
...@@ -4676,10 +4676,10 @@ Modifications to the H2 source code must be published. ...@@ -4676,10 +4676,10 @@ Modifications to the H2 source code must be published.
You don't need to provide the source code of H2 if you did not modify anything. You don't need to provide the source code of H2 if you did not modify anything.
@license_1008_p @license_1008_p
However, nobody is allowed to rename H2, modify it a little, and sell it as a database engine without telling the customers it is in fact H2. This happened to HSQLDB: A company called 'bungisoft' copied HSQLDB, renamed it to 'RedBase', and tried to sell it, hiding the fact that it was in fact just HSQLDB. It seems 'bungisoft' does not exist any more, but you can use the Wayback Machine of http://www.archive.org and visit old web pages of http://www.bungisoft.com . However, nobody is allowed to rename H2, modify it a little, and sell it as a database engine without telling the customers it is in fact H2. This happened to HSQLDB: a company called 'bungisoft' copied HSQLDB, renamed it to 'RedBase', and tried to sell it, hiding the fact that it was in fact just HSQLDB. It seems 'bungisoft' does not exist any more, but you can use the Wayback Machine of http://www.archive.org and visit old web pages of http://www.bungisoft.com .
@license_1009_p @license_1009_p
About porting the source code to another language (for example C# or C++): Converted source code (even if done manually) stays under the same copyright and license as the original code. The copyright of the ported source code does not (automatically) go to the person who ported the code. About porting the source code to another language (for example C# or C++): converted source code (even if done manually) stays under the same copyright and license as the original code. The copyright of the ported source code does not (automatically) go to the person who ported the code.
@license_1010_h2 @license_1010_h2
H2 License, Version 1.0 H2 License, Version 1.0
...@@ -6100,263 +6100,263 @@ Database Profiling ...@@ -6100,263 +6100,263 @@ Database Profiling
@performance_1005_a @performance_1005_a
Performance Tuning Performance Tuning
@performance_1006_h2 @performance_1006_a
Fast Database Import
@performance_1007_h2
Performance Comparison Performance Comparison
@performance_1007_p @performance_1008_p
In many cases H2 is faster than other (open source and not open source) database engines. Please note this is mostly a single connection benchmark run on one computer. In many cases H2 is faster than other (open source and not open source) database engines. Please note this is mostly a single connection benchmark run on one computer.
@performance_1008_h3 @performance_1009_h3
Embedded Embedded
@performance_1009_th @performance_1010_th
Test Case Test Case
@performance_1010_th @performance_1011_th
Unit Unit
@performance_1011_th @performance_1012_th
H2 H2
@performance_1012_th @performance_1013_th
HSQLDB HSQLDB
@performance_1013_th @performance_1014_th
Derby Derby
@performance_1014_td
Simple: Init
@performance_1015_td @performance_1015_td
ms Simple: Init
@performance_1016_td @performance_1016_td
547 ms
@performance_1017_td @performance_1017_td
532 547
@performance_1018_td @performance_1018_td
2594 532
@performance_1019_td @performance_1019_td
Simple: Query (random) 2594
@performance_1020_td @performance_1020_td
ms Simple: Query (random)
@performance_1021_td @performance_1021_td
250 ms
@performance_1022_td @performance_1022_td
391 250
@performance_1023_td @performance_1023_td
1515 391
@performance_1024_td @performance_1024_td
Simple: Query (sequential) 1515
@performance_1025_td @performance_1025_td
ms Simple: Query (sequential)
@performance_1026_td @performance_1026_td
188 ms
@performance_1027_td @performance_1027_td
313 188
@performance_1028_td @performance_1028_td
1406 313
@performance_1029_td @performance_1029_td
Simple: Update (random) 1406
@performance_1030_td @performance_1030_td
ms Simple: Update (random)
@performance_1031_td @performance_1031_td
812 ms
@performance_1032_td @performance_1032_td
1750 812
@performance_1033_td @performance_1033_td
17704 1750
@performance_1034_td @performance_1034_td
Simple: Delete (sequential) 17704
@performance_1035_td @performance_1035_td
ms Simple: Delete (sequential)
@performance_1036_td @performance_1036_td
203 ms
@performance_1037_td @performance_1037_td
250 203
@performance_1038_td @performance_1038_td
8843 250
@performance_1039_td @performance_1039_td
Simple: Memory Usage 8843
@performance_1040_td @performance_1040_td
MB Simple: Memory Usage
@performance_1041_td @performance_1041_td
7 MB
@performance_1042_td @performance_1042_td
11 7
@performance_1043_td @performance_1043_td
11 11
@performance_1044_td @performance_1044_td
BenchA: Init 11
@performance_1045_td @performance_1045_td
ms BenchA: Init
@performance_1046_td @performance_1046_td
578 ms
@performance_1047_td @performance_1047_td
719 578
@performance_1048_td @performance_1048_td
3328 719
@performance_1049_td @performance_1049_td
BenchA: Transactions 3328
@performance_1050_td @performance_1050_td
ms BenchA: Transactions
@performance_1051_td @performance_1051_td
3047 ms
@performance_1052_td @performance_1052_td
2406 3047
@performance_1053_td @performance_1053_td
12907 2406
@performance_1054_td @performance_1054_td
BenchA: Memory Usage 12907
@performance_1055_td @performance_1055_td
MB BenchA: Memory Usage
@performance_1056_td @performance_1056_td
10 MB
@performance_1057_td @performance_1057_td
15 10
@performance_1058_td @performance_1058_td
10 15
@performance_1059_td @performance_1059_td
BenchB: Init 10
@performance_1060_td @performance_1060_td
ms BenchB: Init
@performance_1061_td @performance_1061_td
2141 ms
@performance_1062_td @performance_1062_td
2406 2141
@performance_1063_td @performance_1063_td
11562 2406
@performance_1064_td @performance_1064_td
BenchB: Transactions 11562
@performance_1065_td @performance_1065_td
ms BenchB: Transactions
@performance_1066_td @performance_1066_td
1125 ms
@performance_1067_td @performance_1067_td
1375 1125
@performance_1068_td @performance_1068_td
3625 1375
@performance_1069_td @performance_1069_td
BenchB: Memory Usage 3625
@performance_1070_td @performance_1070_td
MB BenchB: Memory Usage
@performance_1071_td @performance_1071_td
9 MB
@performance_1072_td @performance_1072_td
11 9
@performance_1073_td @performance_1073_td
8 11
@performance_1074_td @performance_1074_td
BenchC: Init 8
@performance_1075_td @performance_1075_td
ms BenchC: Init
@performance_1076_td @performance_1076_td
688 ms
@performance_1077_td @performance_1077_td
594 688
@performance_1078_td @performance_1078_td
4500 594
@performance_1079_td @performance_1079_td
BenchC: Transactions 4500
@performance_1080_td @performance_1080_td
ms BenchC: Transactions
@performance_1081_td @performance_1081_td
1906 ms
@performance_1082_td @performance_1082_td
64062 1906
@performance_1083_td @performance_1083_td
6047 64062
@performance_1084_td @performance_1084_td
BenchC: Memory Usage 6047
@performance_1085_td @performance_1085_td
MB BenchC: Memory Usage
@performance_1086_td @performance_1086_td
11 MB
@performance_1087_td @performance_1087_td
17 11
@performance_1088_td @performance_1088_td
11 17
@performance_1089_td @performance_1089_td
Executed statements 11
@performance_1090_td @performance_1090_td
# Executed statements
@performance_1091_td @performance_1091_td
322929 #
@performance_1092_td @performance_1092_td
322929 322929
...@@ -6365,382 +6365,382 @@ Executed statements ...@@ -6365,382 +6365,382 @@ Executed statements
322929 322929
@performance_1094_td @performance_1094_td
Total time 322929
@performance_1095_td @performance_1095_td
ms Total time
@performance_1096_td @performance_1096_td
11485 ms
@performance_1097_td @performance_1097_td
74798 11485
@performance_1098_td @performance_1098_td
74031 74798
@performance_1099_td @performance_1099_td
Statements per second 74031
@performance_1100_td @performance_1100_td
# Statements per second
@performance_1101_td @performance_1101_td
28117 #
@performance_1102_td @performance_1102_td
4317 28117
@performance_1103_td @performance_1103_td
4317
@performance_1104_td
4362 4362
@performance_1104_h3 @performance_1105_h3
Client-Server Client-Server
@performance_1105_th @performance_1106_th
Test Case Test Case
@performance_1106_th @performance_1107_th
Unit Unit
@performance_1107_th @performance_1108_th
H2 H2
@performance_1108_th @performance_1109_th
HSQLDB HSQLDB
@performance_1109_th @performance_1110_th
Derby Derby
@performance_1110_th @performance_1111_th
PostgreSQL PostgreSQL
@performance_1111_th @performance_1112_th
MySQL MySQL
@performance_1112_td
Simple: Init
@performance_1113_td @performance_1113_td
ms Simple: Init
@performance_1114_td @performance_1114_td
2782 ms
@performance_1115_td @performance_1115_td
2656 2782
@performance_1116_td @performance_1116_td
5625 2656
@performance_1117_td @performance_1117_td
4563 5625
@performance_1118_td @performance_1118_td
3484 4563
@performance_1119_td @performance_1119_td
Simple: Query (random) 3484
@performance_1120_td @performance_1120_td
ms Simple: Query (random)
@performance_1121_td @performance_1121_td
3093 ms
@performance_1122_td @performance_1122_td
2703 3093
@performance_1123_td @performance_1123_td
6688 2703
@performance_1124_td @performance_1124_td
4812 6688
@performance_1125_td @performance_1125_td
3860 4812
@performance_1126_td @performance_1126_td
Simple: Query (sequential) 3860
@performance_1127_td @performance_1127_td
ms Simple: Query (sequential)
@performance_1128_td @performance_1128_td
2969 ms
@performance_1129_td @performance_1129_td
2594 2969
@performance_1130_td @performance_1130_td
6437 2594
@performance_1131_td @performance_1131_td
4719 6437
@performance_1132_td @performance_1132_td
3625 4719
@performance_1133_td @performance_1133_td
Simple: Update (random) 3625
@performance_1134_td @performance_1134_td
ms Simple: Update (random)
@performance_1135_td @performance_1135_td
2969 ms
@performance_1136_td @performance_1136_td
3531 2969
@performance_1137_td @performance_1137_td
18250 3531
@performance_1138_td @performance_1138_td
5953 18250
@performance_1139_td @performance_1139_td
5125 5953
@performance_1140_td @performance_1140_td
Simple: Delete (sequential) 5125
@performance_1141_td @performance_1141_td
ms Simple: Delete (sequential)
@performance_1142_td @performance_1142_td
1047 ms
@performance_1143_td @performance_1143_td
1250 1047
@performance_1144_td @performance_1144_td
6875 1250
@performance_1145_td @performance_1145_td
2485 6875
@performance_1146_td @performance_1146_td
2390 2485
@performance_1147_td @performance_1147_td
Simple: Memory Usage 2390
@performance_1148_td @performance_1148_td
MB Simple: Memory Usage
@performance_1149_td @performance_1149_td
7 MB
@performance_1150_td @performance_1150_td
11 7
@performance_1151_td @performance_1151_td
14 11
@performance_1152_td @performance_1152_td
0 14
@performance_1153_td @performance_1153_td
0 0
@performance_1154_td @performance_1154_td
BenchA: Init 0
@performance_1155_td @performance_1155_td
ms BenchA: Init
@performance_1156_td @performance_1156_td
2250 ms
@performance_1157_td @performance_1157_td
2453 2250
@performance_1158_td @performance_1158_td
6031 2453
@performance_1159_td @performance_1159_td
4328 6031
@performance_1160_td @performance_1160_td
3625 4328
@performance_1161_td @performance_1161_td
BenchA: Transactions 3625
@performance_1162_td @performance_1162_td
ms BenchA: Transactions
@performance_1163_td @performance_1163_td
10250 ms
@performance_1164_td @performance_1164_td
9016 10250
@performance_1165_td @performance_1165_td
21484 9016
@performance_1166_td @performance_1166_td
15609 21484
@performance_1167_td @performance_1167_td
11172 15609
@performance_1168_td @performance_1168_td
BenchA: Memory Usage 11172
@performance_1169_td @performance_1169_td
MB BenchA: Memory Usage
@performance_1170_td @performance_1170_td
10 MB
@performance_1171_td @performance_1171_td
15 10
@performance_1172_td @performance_1172_td
10 15
@performance_1173_td @performance_1173_td
0 10
@performance_1174_td @performance_1174_td
1 0
@performance_1175_td @performance_1175_td
BenchB: Init 1
@performance_1176_td @performance_1176_td
ms BenchB: Init
@performance_1177_td @performance_1177_td
9500 ms
@performance_1178_td @performance_1178_td
10672 9500
@performance_1179_td @performance_1179_td
22609 10672
@performance_1180_td @performance_1180_td
19609 22609
@performance_1181_td @performance_1181_td
13406 19609
@performance_1182_td @performance_1182_td
BenchB: Transactions 13406
@performance_1183_td @performance_1183_td
ms BenchB: Transactions
@performance_1184_td @performance_1184_td
2734 ms
@performance_1185_td @performance_1185_td
2656 2734
@performance_1186_td @performance_1186_td
3875 2656
@performance_1187_td @performance_1187_td
4688 3875
@performance_1188_td @performance_1188_td
2531 4688
@performance_1189_td @performance_1189_td
BenchB: Memory Usage 2531
@performance_1190_td @performance_1190_td
MB BenchB: Memory Usage
@performance_1191_td @performance_1191_td
10 MB
@performance_1192_td @performance_1192_td
11 10
@performance_1193_td @performance_1193_td
11 11
@performance_1194_td @performance_1194_td
1 11
@performance_1195_td @performance_1195_td
1 1
@performance_1196_td @performance_1196_td
BenchC: Init 1
@performance_1197_td @performance_1197_td
ms BenchC: Init
@performance_1198_td @performance_1198_td
1860 ms
@performance_1199_td @performance_1199_td
1484 1860
@performance_1200_td @performance_1200_td
6890 1484
@performance_1201_td @performance_1201_td
2219 6890
@performance_1202_td @performance_1202_td
3438 2219
@performance_1203_td @performance_1203_td
BenchC: Transactions 3438
@performance_1204_td @performance_1204_td
ms BenchC: Transactions
@performance_1205_td @performance_1205_td
9046 ms
@performance_1206_td @performance_1206_td
63266 9046
@performance_1207_td @performance_1207_td
18641 63266
@performance_1208_td @performance_1208_td
11703 18641
@performance_1209_td @performance_1209_td
7421 11703
@performance_1210_td @performance_1210_td
BenchC: Memory Usage 7421
@performance_1211_td @performance_1211_td
MB BenchC: Memory Usage
@performance_1212_td @performance_1212_td
12 MB
@performance_1213_td @performance_1213_td
17 12
@performance_1214_td @performance_1214_td
13 17
@performance_1215_td @performance_1215_td
0 13
@performance_1216_td @performance_1216_td
1 0
@performance_1217_td @performance_1217_td
Executed statements 1
@performance_1218_td @performance_1218_td
# Executed statements
@performance_1219_td @performance_1219_td
322929 #
@performance_1220_td @performance_1220_td
322929 322929
...@@ -6755,595 +6755,619 @@ Executed statements ...@@ -6755,595 +6755,619 @@ Executed statements
322929 322929
@performance_1224_td @performance_1224_td
Total time 322929
@performance_1225_td @performance_1225_td
ms Total time
@performance_1226_td @performance_1226_td
48500 ms
@performance_1227_td @performance_1227_td
102281 48500
@performance_1228_td @performance_1228_td
123405 102281
@performance_1229_td @performance_1229_td
80688 123405
@performance_1230_td @performance_1230_td
60077 80688
@performance_1231_td @performance_1231_td
Statements per second 60077
@performance_1232_td @performance_1232_td
# Statements per second
@performance_1233_td @performance_1233_td
6658 #
@performance_1234_td @performance_1234_td
3157 6658
@performance_1235_td @performance_1235_td
2616 3157
@performance_1236_td @performance_1236_td
4002 2616
@performance_1237_td @performance_1237_td
4002
@performance_1238_td
5375 5375
@performance_1238_h3 @performance_1239_h3
Benchmark Results and Comments Benchmark Results and Comments
@performance_1239_h4 @performance_1240_h4
H2 H2
@performance_1240_p @performance_1241_p
Version 1.1.114 (2009-06-01) was used for the test. For simpler operations, the performance of H2 is about the same as for HSQLDB. For more complex queries, the query optimizer is very important. However H2 is not very fast in every case, certain kind of queries may still be slow. One situation where is H2 is slow is large result sets, because they are buffered to disk if more than a certain number of records are returned. The advantage of buffering is, there is no limit on the result set size. The open/close time is almost fixed, because of the file locking protocol: The engine waits some time after opening a database to ensure the database files are not opened by another process. Version 1.1.114 (2009-06-01) was used for the test. For simpler operations, the performance of H2 is about the same as for HSQLDB. For more complex queries, the query optimizer is very important. However H2 is not very fast in every case, certain kind of queries may still be slow. One situation where is H2 is slow is large result sets, because they are buffered to disk if more than a certain number of records are returned. The advantage of buffering is, there is no limit on the result set size. The open/close time is almost fixed, because of the file locking protocol: the engine waits some time after opening a database to ensure the database files are not opened by another process.
@performance_1241_h4 @performance_1242_h4
HSQLDB HSQLDB
@performance_1242_p @performance_1243_p
Version 1.8.0.10 was used for the test. Cached tables are used in this test (hsqldb.default_table_type=cached), and the write delay is 1 second (SET WRITE_DELAY 1). HSQLDB is fast when using simple operations. HSQLDB is very slow in the last test (BenchC: Transactions), probably because is has a bad query optimizer. One query where HSQLDB is slow is a two-table join: Version 1.8.0.10 was used for the test. Cached tables are used in this test (hsqldb.default_table_type=cached), and the write delay is 1 second (SET WRITE_DELAY 1). HSQLDB is fast when using simple operations. HSQLDB is very slow in the last test (BenchC: Transactions), probably because is has a bad query optimizer. One query where HSQLDB is slow is a two-table join:
@performance_1243_p @performance_1244_p
The PolePosition benchmark also shows that the query optimizer does not do a very good job for some queries. Another disadvantage of HSQLDB is the slow startup / shutdown time (currently not listed) when using bigger databases. The reason is, a backup of the whole data is made whenever the database is opened or closed. The PolePosition benchmark also shows that the query optimizer does not do a very good job for some queries. Another disadvantage of HSQLDB is the slow startup / shutdown time (currently not listed) when using bigger databases. The reason is, a backup of the whole data is made whenever the database is opened or closed.
@performance_1244_h4 @performance_1245_h4
Derby Derby
@performance_1245_p @performance_1246_p
Version 10.4.2.0 was used for the test. Derby is clearly the slowest embedded database in this test. This seems to be a structural problem, because all operations are really slow. It will be hard for the developers of Derby to improve the performance to a reasonable level. A few problems have been identified: Leaving autocommit on is a problem for Derby. If it is switched off during the whole test, the results are about 20% better for Derby. Derby supports a testing mode (system property derby.system.durability=test) where durability is disabled. According to the documentation, this setting should be used for testing only, as the database may not recover after a crash. Enabling this setting improves performance by a factor of 2.6 (embedded mode) or 1.4 (server mode). Even if enabled, Derby is still less than half as fast as H2 in default mode. Version 10.4.2.0 was used for the test. Derby is clearly the slowest embedded database in this test. This seems to be a structural problem, because all operations are really slow. It will be hard for the developers of Derby to improve the performance to a reasonable level. A few problems have been identified: leaving autocommit on is a problem for Derby. If it is switched off during the whole test, the results are about 20% better for Derby. Derby supports a testing mode (system property derby.system.durability=test) where durability is disabled. According to the documentation, this setting should be used for testing only, as the database may not recover after a crash. Enabling this setting improves performance by a factor of 2.6 (embedded mode) or 1.4 (server mode). Even if enabled, Derby is still less than half as fast as H2 in default mode.
@performance_1246_h4 @performance_1247_h4
PostgreSQL PostgreSQL
@performance_1247_p @performance_1248_p
Version 8.3.7 was used for the test. The following options where changed in postgresql.conf: fsync = off, commit_delay = 1000. PostgreSQL is run in server mode. It looks like the base performance is slower than MySQL, the reason could be the network layer. The memory usage number is incorrect, because only the memory usage of the JDBC driver is measured. Version 8.3.7 was used for the test. The following options where changed in postgresql.conf: fsync = off, commit_delay = 1000. PostgreSQL is run in server mode. It looks like the base performance is slower than MySQL, the reason could be the network layer. The memory usage number is incorrect, because only the memory usage of the JDBC driver is measured.
@performance_1248_h4 @performance_1249_h4
MySQL MySQL
@performance_1249_p @performance_1250_p
Version 5.1.34-community was used for the test. MySQL was run with the InnoDB backend. The setting innodb_flush_log_at_trx_commit (found in the my.ini file) was set to 0. Otherwise (and by default), MySQL is really slow (around 140 statements per second in this test) because it tries to flush the data to disk for each commit. For small transactions (when autocommit is on) this is really slow. But many use cases use small or relatively small transactions. Too bad this setting is not listed in the configuration wizard, and it always overwritten when using the wizard. You need to change this setting manually in the file my.ini, and then restart the service. The memory usage number is incorrect, because only the memory usage of the JDBC driver is measured. Version 5.1.34-community was used for the test. MySQL was run with the InnoDB backend. The setting innodb_flush_log_at_trx_commit (found in the my.ini file) was set to 0. Otherwise (and by default), MySQL is really slow (around 140 statements per second in this test) because it tries to flush the data to disk for each commit. For small transactions (when autocommit is on) this is really slow. But many use cases use small or relatively small transactions. Too bad this setting is not listed in the configuration wizard, and it always overwritten when using the wizard. You need to change this setting manually in the file my.ini, and then restart the service. The memory usage number is incorrect, because only the memory usage of the JDBC driver is measured.
@performance_1250_h4 @performance_1251_h4
Firebird Firebird
@performance_1251_p @performance_1252_p
Firebird 1.5 (default installation) was tested, but the results are not published currently. It is possible to run the performance test with the Firebird database, and any information on how to configure Firebird for higher performance are welcome. Firebird 1.5 (default installation) was tested, but the results are not published currently. It is possible to run the performance test with the Firebird database, and any information on how to configure Firebird for higher performance are welcome.
@performance_1252_h4 @performance_1253_h4
Why Oracle / MS SQL Server / DB2 are Not Listed Why Oracle / MS SQL Server / DB2 are Not Listed
@performance_1253_p @performance_1254_p
The license of these databases does not allow to publish benchmark results. This doesn't mean that they are fast. They are in fact quite slow, and need a lot of memory. But you will need to test this yourself. SQLite was not tested because the JDBC driver doesn't support transactions. The license of these databases does not allow to publish benchmark results. This doesn't mean that they are fast. They are in fact quite slow, and need a lot of memory. But you will need to test this yourself. SQLite was not tested because the JDBC driver doesn't support transactions.
@performance_1254_h3 @performance_1255_h3
About this Benchmark About this Benchmark
@performance_1255_h4 @performance_1256_h4
How to Run How to Run
@performance_1256_p @performance_1257_p
This test was executed as follows: This test was executed as follows:
@performance_1257_h4 @performance_1258_h4
Separate Process per Database Separate Process per Database
@performance_1258_p @performance_1259_p
For each database, a new process is started, to ensure the previous test does not impact the current test. For each database, a new process is started, to ensure the previous test does not impact the current test.
@performance_1259_h4 @performance_1260_h4
Number of Connections Number of Connections
@performance_1260_p @performance_1261_p
This is mostly a single-connection benchmark. BenchB uses multiple connections; the other tests use one connection. This is mostly a single-connection benchmark. BenchB uses multiple connections; the other tests use one connection.
@performance_1261_h4 @performance_1262_h4
Real-World Tests Real-World Tests
@performance_1262_p @performance_1263_p
Good benchmarks emulate real-world use cases. This benchmark includes 3 test cases: A simple test case with one table and many small updates / deletes. BenchA is similar to the TPC-A test, but single connection / single threaded (see also: www.tpc.org). BenchB is similar to the TPC-B test, using multiple connections (one thread per connection). BenchC is similar to the TPC-C test, but single connection / single threaded. Good benchmarks emulate real-world use cases. This benchmark includes 4 test cases: BenchSimple uses one table and many small updates / deletes. BenchA is similar to the TPC-A test, but single connection / single threaded (see also: www.tpc.org). BenchB is similar to the TPC-B test, using multiple connections (one thread per connection). BenchC is similar to the TPC-C test, but single connection / single threaded.
@performance_1263_h4 @performance_1264_h4
Comparing Embedded with Server Databases Comparing Embedded with Server Databases
@performance_1264_p @performance_1265_p
This is mainly a benchmark for embedded databases (where the application runs in the same virtual machine as the database engine). However MySQL and PostgreSQL are not Java databases and cannot be embedded into a Java application. For the Java databases, both embedded and server modes are tested. This is mainly a benchmark for embedded databases (where the application runs in the same virtual machine as the database engine). However MySQL and PostgreSQL are not Java databases and cannot be embedded into a Java application. For the Java databases, both embedded and server modes are tested.
@performance_1265_h4 @performance_1266_h4
Test Platform Test Platform
@performance_1266_p @performance_1267_p
This test is run on Windows XP with the virus scanner switched off. The VM used is Sun JDK 1.5. This test is run on Windows XP with the virus scanner switched off. The VM used is Sun JDK 1.5.
@performance_1267_h4 @performance_1268_h4
Multiple Runs Multiple Runs
@performance_1268_p @performance_1269_p
When a Java benchmark is run first, the code is not fully compiled and therefore runs slower than when running multiple times. A benchmark should always run the same test multiple times and ignore the first run(s). This benchmark runs three times, but only the last run is measured. When a Java benchmark is run first, the code is not fully compiled and therefore runs slower than when running multiple times. A benchmark should always run the same test multiple times and ignore the first run(s). This benchmark runs three times, but only the last run is measured.
@performance_1269_h4 @performance_1270_h4
Memory Usage Memory Usage
@performance_1270_p @performance_1271_p
It is not enough to measure the time taken, the memory usage is important as well. Performance can be improved by using a bigger cache, but the amount of memory is limited. HSQLDB tables are kept fully in memory by default; this benchmark uses 'disk based' tables for all databases. Unfortunately, it is not so easy to calculate the memory usage of PostgreSQL and MySQL, because they run in a different process than the test. This benchmark currently does not print memory usage of those databases. It is not enough to measure the time taken, the memory usage is important as well. Performance can be improved by using a bigger cache, but the amount of memory is limited. HSQLDB tables are kept fully in memory by default; this benchmark uses 'disk based' tables for all databases. Unfortunately, it is not so easy to calculate the memory usage of PostgreSQL and MySQL, because they run in a different process than the test. This benchmark currently does not print memory usage of those databases.
@performance_1271_h4 @performance_1272_h4
Delayed Operations Delayed Operations
@performance_1272_p @performance_1273_p
Some databases delay some operations (for example flushing the buffers) until after the benchmark is run. This benchmark waits between each database tested, and each database runs in a different process (sequentially). Some databases delay some operations (for example flushing the buffers) until after the benchmark is run. This benchmark waits between each database tested, and each database runs in a different process (sequentially).
@performance_1273_h4 @performance_1274_h4
Transaction Commit / Durability Transaction Commit / Durability
@performance_1274_p @performance_1275_p
Durability means transaction committed to the database will not be lost. Some databases (for example MySQL) try to enforce this by default by calling fsync() to flush the buffers, but most hard drives don't actually flush all data. Calling fsync() slows down transaction commit a lot, but doesn't always make data durable. When comparing the results, it is important to think about the effect. Many database suggest to 'batch' operations when possible. This benchmark switches off autocommit when loading the data, and calls commit after each 1000 inserts. However many applications need 'short' transactions at runtime (a commit after each update). This benchmark commits after each update / delete in the simple benchmark, and after each business transaction in the other benchmarks. For databases that support delayed commits, a delay of one second is used. Durability means transaction committed to the database will not be lost. Some databases (for example MySQL) try to enforce this by default by calling fsync() to flush the buffers, but most hard drives don't actually flush all data. Calling fsync() slows down transaction commit a lot, but doesn't always make data durable. When comparing the results, it is important to think about the effect. Many database suggest to 'batch' operations when possible. This benchmark switches off autocommit when loading the data, and calls commit after each 1000 inserts. However many applications need 'short' transactions at runtime (a commit after each update). This benchmark commits after each update / delete in the simple benchmark, and after each business transaction in the other benchmarks. For databases that support delayed commits, a delay of one second is used.
@performance_1275_h4 @performance_1276_h4
Using Prepared Statements Using Prepared Statements
@performance_1276_p @performance_1277_p
Wherever possible, the test cases use prepared statements. Wherever possible, the test cases use prepared statements.
@performance_1277_h4 @performance_1278_h4
Currently Not Tested: Startup Time Currently Not Tested: Startup Time
@performance_1278_p @performance_1279_p
The startup time of a database engine is important as well for embedded use. This time is not measured currently. Also, not tested is the time used to create a database and open an existing database. Here, one (wrapper) connection is opened at the start, and for each step a new connection is opened and then closed. The startup time of a database engine is important as well for embedded use. This time is not measured currently. Also, not tested is the time used to create a database and open an existing database. Here, one (wrapper) connection is opened at the start, and for each step a new connection is opened and then closed.
@performance_1279_h2 @performance_1280_h2
PolePosition Benchmark PolePosition Benchmark
@performance_1280_p @performance_1281_p
The PolePosition is an open source benchmark. The algorithms are all quite simple. It was developed / sponsored by db4o. The PolePosition is an open source benchmark. The algorithms are all quite simple. It was developed / sponsored by db4o.
@performance_1281_th @performance_1282_th
Test Case Test Case
@performance_1282_th @performance_1283_th
Unit Unit
@performance_1283_th @performance_1284_th
H2 H2
@performance_1284_th @performance_1285_th
HSQLDB HSQLDB
@performance_1285_th @performance_1286_th
MySQL MySQL
@performance_1286_td @performance_1287_td
Melbourne write Melbourne write
@performance_1287_td @performance_1288_td
ms ms
@performance_1288_td @performance_1289_td
369 369
@performance_1289_td @performance_1290_td
249 249
@performance_1290_td @performance_1291_td
2022 2022
@performance_1291_td @performance_1292_td
Melbourne read Melbourne read
@performance_1292_td @performance_1293_td
ms ms
@performance_1293_td @performance_1294_td
47 47
@performance_1294_td @performance_1295_td
49 49
@performance_1295_td @performance_1296_td
93 93
@performance_1296_td @performance_1297_td
Melbourne read_hot Melbourne read_hot
@performance_1297_td @performance_1298_td
ms ms
@performance_1298_td @performance_1299_td
24 24
@performance_1299_td @performance_1300_td
43 43
@performance_1300_td @performance_1301_td
95 95
@performance_1301_td @performance_1302_td
Melbourne delete Melbourne delete
@performance_1302_td @performance_1303_td
ms ms
@performance_1303_td @performance_1304_td
147 147
@performance_1304_td @performance_1305_td
133 133
@performance_1305_td @performance_1306_td
176 176
@performance_1306_td @performance_1307_td
Sepang write Sepang write
@performance_1307_td @performance_1308_td
ms ms
@performance_1308_td @performance_1309_td
965 965
@performance_1309_td @performance_1310_td
1201 1201
@performance_1310_td @performance_1311_td
3213 3213
@performance_1311_td @performance_1312_td
Sepang read Sepang read
@performance_1312_td @performance_1313_td
ms ms
@performance_1313_td @performance_1314_td
765 765
@performance_1314_td @performance_1315_td
948 948
@performance_1315_td @performance_1316_td
3455 3455
@performance_1316_td @performance_1317_td
Sepang read_hot Sepang read_hot
@performance_1317_td @performance_1318_td
ms ms
@performance_1318_td @performance_1319_td
789 789
@performance_1319_td @performance_1320_td
859 859
@performance_1320_td @performance_1321_td
3563 3563
@performance_1321_td @performance_1322_td
Sepang delete Sepang delete
@performance_1322_td @performance_1323_td
ms ms
@performance_1323_td @performance_1324_td
1384 1384
@performance_1324_td @performance_1325_td
1596 1596
@performance_1325_td @performance_1326_td
6214 6214
@performance_1326_td @performance_1327_td
Bahrain write Bahrain write
@performance_1327_td @performance_1328_td
ms ms
@performance_1328_td @performance_1329_td
1186 1186
@performance_1329_td @performance_1330_td
1387 1387
@performance_1330_td @performance_1331_td
6904 6904
@performance_1331_td @performance_1332_td
Bahrain query_indexed_string Bahrain query_indexed_string
@performance_1332_td @performance_1333_td
ms ms
@performance_1333_td @performance_1334_td
336 336
@performance_1334_td @performance_1335_td
170 170
@performance_1335_td @performance_1336_td
693 693
@performance_1336_td @performance_1337_td
Bahrain query_string Bahrain query_string
@performance_1337_td @performance_1338_td
ms ms
@performance_1338_td @performance_1339_td
18064 18064
@performance_1339_td @performance_1340_td
39703 39703
@performance_1340_td @performance_1341_td
41243 41243
@performance_1341_td @performance_1342_td
Bahrain query_indexed_int Bahrain query_indexed_int
@performance_1342_td @performance_1343_td
ms ms
@performance_1343_td @performance_1344_td
104 104
@performance_1344_td @performance_1345_td
134 134
@performance_1345_td @performance_1346_td
678 678
@performance_1346_td @performance_1347_td
Bahrain update Bahrain update
@performance_1347_td @performance_1348_td
ms ms
@performance_1348_td @performance_1349_td
191 191
@performance_1349_td @performance_1350_td
87 87
@performance_1350_td @performance_1351_td
159 159
@performance_1351_td @performance_1352_td
Bahrain delete Bahrain delete
@performance_1352_td @performance_1353_td
ms ms
@performance_1353_td @performance_1354_td
1215 1215
@performance_1354_td @performance_1355_td
729 729
@performance_1355_td @performance_1356_td
6812 6812
@performance_1356_td @performance_1357_td
Imola retrieve Imola retrieve
@performance_1357_td @performance_1358_td
ms ms
@performance_1358_td @performance_1359_td
198 198
@performance_1359_td @performance_1360_td
194 194
@performance_1360_td @performance_1361_td
4036 4036
@performance_1361_td @performance_1362_td
Barcelona write Barcelona write
@performance_1362_td @performance_1363_td
ms ms
@performance_1363_td @performance_1364_td
413 413
@performance_1364_td @performance_1365_td
832 832
@performance_1365_td @performance_1366_td
3191 3191
@performance_1366_td @performance_1367_td
Barcelona read Barcelona read
@performance_1367_td @performance_1368_td
ms ms
@performance_1368_td @performance_1369_td
119 119
@performance_1369_td @performance_1370_td
160 160
@performance_1370_td @performance_1371_td
1177 1177
@performance_1371_td @performance_1372_td
Barcelona query Barcelona query
@performance_1372_td @performance_1373_td
ms ms
@performance_1373_td @performance_1374_td
20 20
@performance_1374_td @performance_1375_td
5169 5169
@performance_1375_td @performance_1376_td
101 101
@performance_1376_td @performance_1377_td
Barcelona delete Barcelona delete
@performance_1377_td @performance_1378_td
ms ms
@performance_1378_td @performance_1379_td
388 388
@performance_1379_td @performance_1380_td
319 319
@performance_1380_td @performance_1381_td
3287 3287
@performance_1381_td @performance_1382_td
Total Total
@performance_1382_td @performance_1383_td
ms ms
@performance_1383_td @performance_1384_td
26724 26724
@performance_1384_td @performance_1385_td
53962 53962
@performance_1385_td @performance_1386_td
87112 87112
@performance_1386_p @performance_1387_p
There are a few problems with the PolePosition test: There are a few problems with the PolePosition test:
@performance_1387_li @performance_1388_li
HSQLDB uses in-memory tables by default while H2 uses persistent tables. The HSQLDB version included in PolePosition does not support changing this, so you need to replace poleposition-0.20/lib/hsqldb.jar with a newer version (for example hsqldb-1.8.0.7.jar), and then use the setting hsqldb.connecturl=jdbc:hsqldb:file:data/hsqldb/dbbench2;hsqldb.default_table_type=cached;sql.enforce_size=true in Jdbc.properties. HSQLDB uses in-memory tables by default while H2 uses persistent tables. The HSQLDB version included in PolePosition does not support changing this, so you need to replace poleposition-0.20/lib/hsqldb.jar with a newer version (for example hsqldb-1.8.0.7.jar), and then use the setting hsqldb.connecturl=jdbc:hsqldb:file:data/hsqldb/dbbench2;hsqldb.default_table_type=cached;sql.enforce_size=true in Jdbc.properties.
@performance_1388_li @performance_1389_li
HSQLDB keeps the database open between tests, while H2 closes the database (losing all the cache). To change that, use the database URL jdbc:h2:file:data/h2/dbbench;DB_CLOSE_DELAY=-1 HSQLDB keeps the database open between tests, while H2 closes the database (losing all the cache). To change that, use the database URL jdbc:h2:file:data/h2/dbbench;DB_CLOSE_DELAY=-1
@performance_1389_li @performance_1390_li
The amount of cache memory is quite important, specially for the PolePosition test. Unfortunately, the PolePosition test does not take this into account. The amount of cache memory is quite important, specially for the PolePosition test. Unfortunately, the PolePosition test does not take this into account.
@performance_1390_h2 @performance_1391_h2
Application Profiling Application Profiling
@performance_1391_h3 @performance_1392_h3
Analyze First Analyze First
@performance_1392_p @performance_1393_p
Before trying to optimize performance, it is important to understand where the problem is (what part of the application is slow). Blind optimization or optimization based on guesses should be avoided, because usually it is not an efficient strategy. There are various ways to analyze an application. Sometimes two implementations can be compared using System.currentTimeMillis(). But this does not work for complex applications with many modules, and for memory problems. Before trying to optimize performance, it is important to understand where the problem is (what part of the application is slow). Blind optimization or optimization based on guesses should be avoided, because usually it is not an efficient strategy. There are various ways to analyze an application. Sometimes two implementations can be compared using System.currentTimeMillis(). But this does not work for complex applications with many modules, and for memory problems.
@performance_1393_p @performance_1394_p
A good tool to measure both memory usage and performance is the <a href="http://www.yourkit.com">YourKit Java Profiler</a> . A good tool to measure both memory usage and performance is the <a href="http://www.yourkit.com">YourKit Java Profiler</a> .
@performance_1394_p @performance_1395_p
A simple way to profile an application is to use the built-in profiling tool of java. Example: A simple way to profile an application is to use the built-in profiling tool of java. Example:
@performance_1395_p @performance_1396_p
Unfortunately, it is only possible to profile the application from start to end. Another solution is to create a number of full thread dumps. To do that, first run <code>jps -l</code> to get the process id, and then run <code>jstack &lt;pid&gt;</code> or <code>kill -QUIT &lt;pid&gt;</code> (Linux) or press Ctrl+C (Windows). Unfortunately, it is only possible to profile the application from start to end. Another solution is to create a number of full thread dumps. To do that, first run <code>jps -l</code> to get the process id, and then run <code>jstack &lt;pid&gt;</code> or <code>kill -QUIT &lt;pid&gt;</code> (Linux) or press Ctrl+C (Windows).
@performance_1396_h2 @performance_1397_h2
Database Profiling Database Profiling
@performance_1397_p @performance_1398_p
The ConvertTraceFile tool generates SQL statement statistics at the end of the SQL script file. The format used is similar to the profiling data generated when using java -Xrunhprof. As an example, execute the the following script using the H2 Console: The ConvertTraceFile tool generates SQL statement statistics at the end of the SQL script file. The format used is similar to the profiling data generated when using java -Xrunhprof. As an example, execute the the following script using the H2 Console:
@performance_1398_p @performance_1399_p
Now convert the .trace.db file using the ConvertTraceFile tool: Now convert the .trace.db file using the ConvertTraceFile tool:
@performance_1399_p @performance_1400_p
The generated file <code>test.sql</code> will contain the SQL statements as well as the following profiling data (results vary): The generated file <code>test.sql</code> will contain the SQL statements as well as the following profiling data (results vary):
@performance_1400_h2 @performance_1401_h2
Database Performance Tuning Database Performance Tuning
@performance_1401_h3 @performance_1402_h3
Virus Scanners Virus Scanners
@performance_1402_p @performance_1403_p
Some virus scanners scan files every time they are accessed. It is very important for performance that database files are not scanned for viruses. The database engine does never interprets the data stored in the files as programs, that means even if somebody would store a virus in a database file, this would be harmless (when the virus does not run, it cannot spread). Some virus scanners allow to exclude files by suffix. Make sure files ending with .db are not scanned. Some virus scanners scan files every time they are accessed. It is very important for performance that database files are not scanned for viruses. The database engine does never interprets the data stored in the files as programs, that means even if somebody would store a virus in a database file, this would be harmless (when the virus does not run, it cannot spread). Some virus scanners allow to exclude files by suffix. Make sure files ending with .db are not scanned.
@performance_1403_h3 @performance_1404_h3
Using the Trace Options Using the Trace Options
@performance_1404_p @performance_1405_p
If the main performance hot spots are in the database engine, in many cases the performance can be optimized by creating additional indexes, or changing the schema. Sometimes the application does not directly generate the SQL statements, for example if an O/R mapping tool is used. To view the SQL statements and JDBC API calls, you can use the trace options. For more information, see <a href="features.html#trace_options">Using the Trace Options</a> . If the main performance hot spots are in the database engine, in many cases the performance can be optimized by creating additional indexes, or changing the schema. Sometimes the application does not directly generate the SQL statements, for example if an O/R mapping tool is used. To view the SQL statements and JDBC API calls, you can use the trace options. For more information, see <a href="features.html#trace_options">Using the Trace Options</a> .
@performance_1405_h3 @performance_1406_h3
Index Usage Index Usage
@performance_1406_p @performance_1407_p
This database uses indexes to improve the performance of SELECT, UPDATE and DELETE statements. If a column is used in the WHERE clause of a query, and if an index exists on this column, then the index can be used. Multi-column indexes are used if all or the first columns of the index are used. Both equality lookup and range scans are supported. Indexes are used to order result sets, but only if the condition uses the same index or no index at all. The results are sorted in memory if required. Indexes are created automatically for primary key and unique constraints. Indexes are also created for foreign key constraints, if required. For other columns, indexes need to be created manually using the CREATE INDEX statement. This database uses indexes to improve the performance of SELECT, UPDATE and DELETE statements. If a column is used in the WHERE clause of a query, and if an index exists on this column, then the index can be used. Multi-column indexes are used if all or the first columns of the index are used. Both equality lookup and range scans are supported. Indexes are used to order result sets, but only if the condition uses the same index or no index at all. The results are sorted in memory if required. Indexes are created automatically for primary key and unique constraints. Indexes are also created for foreign key constraints, if required. For other columns, indexes need to be created manually using the CREATE INDEX statement.
@performance_1407_h3 @performance_1408_h3
Optimizer Optimizer
@performance_1408_p @performance_1409_p
This database uses a cost based optimizer. For simple and queries and queries with medium complexity (less than 7 tables in the join), the expected cost (running time) of all possible plans is calculated, and the plan with the lowest cost is used. For more complex queries, the algorithm first tries all possible combinations for the first few tables, and the remaining tables added using a greedy algorithm (this works well for most joins). Afterwards a genetic algorithm is used to test at most 2000 distinct plans. Only left-deep plans are evaluated. This database uses a cost based optimizer. For simple and queries and queries with medium complexity (less than 7 tables in the join), the expected cost (running time) of all possible plans is calculated, and the plan with the lowest cost is used. For more complex queries, the algorithm first tries all possible combinations for the first few tables, and the remaining tables added using a greedy algorithm (this works well for most joins). Afterwards a genetic algorithm is used to test at most 2000 distinct plans. Only left-deep plans are evaluated.
@performance_1409_h3 @performance_1410_h3
Expression Optimization Expression Optimization
@performance_1410_p @performance_1411_p
After the statement is parsed, all expressions are simplified automatically if possible. Operations are evaluated only once if all parameters are constant. Functions are also optimized, but only if the function is constant (always returns the same result for the same parameter values). If the WHERE clause is always false, then the table is not accessed at all. After the statement is parsed, all expressions are simplified automatically if possible. Operations are evaluated only once if all parameters are constant. Functions are also optimized, but only if the function is constant (always returns the same result for the same parameter values). If the WHERE clause is always false, then the table is not accessed at all.
@performance_1411_h3 @performance_1412_h3
COUNT(*) Optimization COUNT(*) Optimization
@performance_1412_p @performance_1413_p
If the query only counts all rows of a table, then the data is not accessed. However, this is only possible if no WHERE clause is used, that means it only works for queries of the form SELECT COUNT(*) FROM table. If the query only counts all rows of a table, then the data is not accessed. However, this is only possible if no WHERE clause is used, that means it only works for queries of the form SELECT COUNT(*) FROM table.
@performance_1413_h3 @performance_1414_h3
Updating Optimizer Statistics / Column Selectivity Updating Optimizer Statistics / Column Selectivity
@performance_1414_p @performance_1415_p
When executing a query, at most one index per joined table can be used. If the same table is joined multiple times, for each join only one index is used. Example: for the query SELECT * FROM TEST T1, TEST T2 WHERE T1.NAME='A' AND T2.ID=T1.ID, two index can be used, in this case the index on NAME for T1 and the index on ID for T2. When executing a query, at most one index per joined table can be used. If the same table is joined multiple times, for each join only one index is used. Example: for the query SELECT * FROM TEST T1, TEST T2 WHERE T1.NAME='A' AND T2.ID=T1.ID, two index can be used, in this case the index on NAME for T1 and the index on ID for T2.
@performance_1415_p @performance_1416_p
If a table has multiple indexes, sometimes more than one index could be used. Example: if there is a table TEST(ID, NAME, FIRSTNAME) and an index on each column, then two indexes could be used for the query SELECT * FROM TEST WHERE NAME='A' AND FIRSTNAME='B', the index on NAME or the index on FIRSTNAME. It is not possible to use both indexes at the same time. Which index is used depends on the selectivity of the column. The selectivity describes the 'uniqueness' of values in a column. A selectivity of 100 means each value appears only once, and a selectivity of 1 means the same value appears in many or most rows. For the query above, the index on NAME should be used if the table contains more distinct names than first names. If a table has multiple indexes, sometimes more than one index could be used. Example: if there is a table TEST(ID, NAME, FIRSTNAME) and an index on each column, then two indexes could be used for the query SELECT * FROM TEST WHERE NAME='A' AND FIRSTNAME='B', the index on NAME or the index on FIRSTNAME. It is not possible to use both indexes at the same time. Which index is used depends on the selectivity of the column. The selectivity describes the 'uniqueness' of values in a column. A selectivity of 100 means each value appears only once, and a selectivity of 1 means the same value appears in many or most rows. For the query above, the index on NAME should be used if the table contains more distinct names than first names.
@performance_1416_p @performance_1417_p
The SQL statement ANALYZE can be used to automatically estimate the selectivity of the columns in the tables. This command should be run from time to time to improve the query plans generated by the optimizer. The SQL statement ANALYZE can be used to automatically estimate the selectivity of the columns in the tables. This command should be run from time to time to improve the query plans generated by the optimizer.
@performance_1417_h3 @performance_1418_h3
Optimization Examples Optimization Examples
@performance_1419_p
See <code>src/test/org/h2/samples/optimizations.sql</code> for a few examples of queries that benefit from special optimizations built into the database.
@performance_1420_h3
Cache Size and Type
@performance_1421_p
By default the cache size of H2 is quite small. Consider using a larger cache size, or enable the second level soft reference cache. See also <a href="features.html#cache_settings">Cache Settings</a> .
@performance_1422_h2
Fast Database Import
@performance_1423_p
To speed up large imports, consider using the following options temporarily:
@performance_1424_li
SET CACHE_SIZE (a large cache is faster)
@performance_1418_p @performance_1425_li
See <code>src/test/org/h2/samples/optimizations.sql</code> for a few examples of queries that benefit from special optimizations built into the database. SET LOCK_MODE 0 (disable locking)
@performance_1419_h3 @performance_1426_li
Cache Size and Type SET LOG 0 (disable the transaction log)
@performance_1420_p @performance_1427_li
By default the cache size of H2 is quite small. Consider using a larger cache size, or enable the second level soft reference cache. See also <a href="features.html#cache_settings">Cache Settings</a> . SET UNDO_LOG 0 (disable the session undo log)
@performance_1428_p
These options can be set in the database URL: <code>jdbc:h2:~/test;CACHE_SIZE=65536;LOCK_MODE=0;LOG=0;UNDO_LOG=0</code> . Most of those options are not recommended for regular use, that means you need to reset them after use.
@quickstart_1000_h1 @quickstart_1000_h1
Quickstart Quickstart
...@@ -7502,7 +7526,7 @@ Enable warning for 'Local variable declaration hides another field or variable'. ...@@ -7502,7 +7526,7 @@ Enable warning for 'Local variable declaration hides another field or variable'.
Test multi-threaded in-memory db access Test multi-threaded in-memory db access
@roadmap_1019_li @roadmap_1019_li
MVCC: Select for update should only lock the selected rows. MVCC: select for update should only lock the selected rows.
@roadmap_1020_li @roadmap_1020_li
Option to shutdown all the running servers (on the same VM). Option to shutdown all the running servers (on the same VM).
...@@ -7679,7 +7703,7 @@ Automatic collection of statistics (auto ANALYZE) ...@@ -7679,7 +7703,7 @@ Automatic collection of statistics (auto ANALYZE)
Server: client ping from time to time (to avoid timeout - is timeout a problem?) Server: client ping from time to time (to avoid timeout - is timeout a problem?)
@roadmap_1078_li @roadmap_1078_li
Copy database: Tool with config GUI and batch mode, extensible (example: compare) Copy database: tool with config GUI and batch mode, extensible (example: compare)
@roadmap_1079_li @roadmap_1079_li
Document, implement tool for long running transactions using user-defined compensation statements. Document, implement tool for long running transactions using user-defined compensation statements.
...@@ -7691,16 +7715,16 @@ Support SET TABLE DUAL READONLY ...@@ -7691,16 +7715,16 @@ Support SET TABLE DUAL READONLY
GCJ: what is the state now? GCJ: what is the state now?
@roadmap_1082_li @roadmap_1082_li
Events for: Database Startup, Connections, Login attempts, Disconnections, Prepare (after parsing), Web Server (see http://docs.openlinksw.com/virtuoso/fn_dbev_startup.html) Events for: database Startup, Connections, Login attempts, Disconnections, Prepare (after parsing), Web Server (see http://docs.openlinksw.com/virtuoso/fn_dbev_startup.html)
@roadmap_1083_li @roadmap_1083_li
Optimization: Log compression Optimization: log compression
@roadmap_1084_li @roadmap_1084_li
Support standard INFORMATION_SCHEMA tables, as defined in http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt; specially KEY_COLUMN_USAGE (http://dev.mysql.com/doc/refman/5.0/en/information-schema.html, http://www.xcdsql.org/Misc/INFORMATION_SCHEMA%20With%20Rolenames.gif) Support standard INFORMATION_SCHEMA tables, as defined in http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt; specially KEY_COLUMN_USAGE (http://dev.mysql.com/doc/refman/5.0/en/information-schema.html, http://www.xcdsql.org/Misc/INFORMATION_SCHEMA%20With%20Rolenames.gif)
@roadmap_1085_li @roadmap_1085_li
Compatibility: in MySQL, HSQLDB, /0.0 is NULL; in PostgreSQL, Derby: Division by zero Compatibility: in MySQL, HSQLDB, /0.0 is NULL; in PostgreSQL, Derby: division by zero
@roadmap_1086_li @roadmap_1086_li
Functional tables should accept parameters from other tables (see FunctionMultiReturn) SELECT * FROM TEST T, P2C(T.A, T.R) Functional tables should accept parameters from other tables (see FunctionMultiReturn) SELECT * FROM TEST T, P2C(T.A, T.R)
...@@ -7718,10 +7742,10 @@ Close all files when closing the database (including LOB files that are open on ...@@ -7718,10 +7742,10 @@ Close all files when closing the database (including LOB files that are open on
EXE file: maybe use http://jsmooth.sourceforge.net EXE file: maybe use http://jsmooth.sourceforge.net
@roadmap_1091_li @roadmap_1091_li
Performance: Automatically build in-memory indexes if the whole table is in memory Performance: automatically build in-memory indexes if the whole table is in memory
@roadmap_1092_li @roadmap_1092_li
H2 Console: The webclient could support more features like phpMyAdmin. H2 Console: the webclient could support more features like phpMyAdmin.
@roadmap_1093_li @roadmap_1093_li
Use Janino to convert Java to C++ Use Janino to convert Java to C++
...@@ -7736,7 +7760,7 @@ Maybe use the 0x1234 notation for binary fields, see MS SQL Server ...@@ -7736,7 +7760,7 @@ Maybe use the 0x1234 notation for binary fields, see MS SQL Server
Support Oracle CONNECT BY in some way: http://www.adp-gmbh.ch/ora/sql/connect_by.html, http://philip.greenspun.com/sql/trees.html Support Oracle CONNECT BY in some way: http://www.adp-gmbh.ch/ora/sql/connect_by.html, http://philip.greenspun.com/sql/trees.html
@roadmap_1097_li @roadmap_1097_li
SQL Server 2005, Oracle: Support COUNT(*) OVER(). See http://www.orafusion.com/art_anlytc.htm SQL Server 2005, Oracle: support COUNT(*) OVER(). See http://www.orafusion.com/art_anlytc.htm
@roadmap_1098_li @roadmap_1098_li
RANK() and DENSE_RANK(), Partition using OVER() RANK() and DENSE_RANK(), Partition using OVER()
...@@ -7781,10 +7805,10 @@ Support custom Collators ...@@ -7781,10 +7805,10 @@ Support custom Collators
Document ROWNUM usage for reports: SELECT ROWNUM, * FROM (subquery) Document ROWNUM usage for reports: SELECT ROWNUM, * FROM (subquery)
@roadmap_1112_li @roadmap_1112_li
Clustering: Reads should be randomly distributed or to a designated database on RAM Clustering: reads should be randomly distributed or to a designated database on RAM
@roadmap_1113_li @roadmap_1113_li
Clustering: When a database is back alive, automatically synchronize with the master Clustering: when a database is back alive, automatically synchronize with the master
@roadmap_1114_li @roadmap_1114_li
Standalone tool to get relevant system properties and add it to the trace output. Standalone tool to get relevant system properties and add it to the trace output.
...@@ -7796,10 +7820,10 @@ Support 'call proc(1=value)' (PostgreSQL, Oracle) ...@@ -7796,10 +7820,10 @@ Support 'call proc(1=value)' (PostgreSQL, Oracle)
JAMon (proxy jdbc driver) JAMon (proxy jdbc driver)
@roadmap_1117_li @roadmap_1117_li
Console: Improve editing data (Tab, Shift-Tab, Enter, Up, Down, Shift+Del?) Console: improve editing data (Tab, Shift-Tab, Enter, Up, Down, Shift+Del?)
@roadmap_1118_li @roadmap_1118_li
Console: Autocomplete Ctrl+Space inserts template Console: autocomplete Ctrl+Space inserts template
@roadmap_1119_li @roadmap_1119_li
Simplify translation ('Donate a translation') Simplify translation ('Donate a translation')
...@@ -7862,7 +7886,7 @@ Backup tool should work with other databases as well ...@@ -7862,7 +7886,7 @@ Backup tool should work with other databases as well
Console: -ifExists doesn't work for the console. Add a flag to disable other dbs Console: -ifExists doesn't work for the console. Add a flag to disable other dbs
@roadmap_1139_li @roadmap_1139_li
Performance: Update in-place Performance: update in-place
@roadmap_1140_li @roadmap_1140_li
Check if 'FSUTIL behavior set disablelastaccess 1' improves the performance (fsutil behavior query disablelastaccess) Check if 'FSUTIL behavior set disablelastaccess 1' improves the performance (fsutil behavior query disablelastaccess)
...@@ -8030,7 +8054,7 @@ Compatibility: # is the start of a single line comment (MySQL) but date quote (A ...@@ -8030,7 +8054,7 @@ Compatibility: # is the start of a single line comment (MySQL) but date quote (A
Run benchmarks with JDK 1.5, JDK 1.6, java -server Run benchmarks with JDK 1.5, JDK 1.6, java -server
@roadmap_1195_li @roadmap_1195_li
Optimizations: Faster hash function for strings, byte arrays Optimizations: faster hash function for strings, byte arrays
@roadmap_1196_li @roadmap_1196_li
DatabaseEventListener: callback for all operations (including expected time, RUNSCRIPT) and cancel functionality DatabaseEventListener: callback for all operations (including expected time, RUNSCRIPT) and cancel functionality
...@@ -8084,7 +8108,7 @@ Time based cache writing (one second after writing the log) ...@@ -8084,7 +8108,7 @@ Time based cache writing (one second after writing the log)
Check state of H2 driver for DDLUtils: https://issues.apache.org/jira/browse/DDLUTILS-185 Check state of H2 driver for DDLUtils: https://issues.apache.org/jira/browse/DDLUTILS-185
@roadmap_1213_li @roadmap_1213_li
Support JMX: Create an MBean for each database and server (support JConsole). See http://thedevcloud.blogspot.com/2008/10/displaying-hsql-database-manager-in.html http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer() http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html Support JMX: create an MBean for each database and server (support JConsole). See http://thedevcloud.blogspot.com/2008/10/displaying-hsql-database-manager-in.html http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer() http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html
@roadmap_1214_li @roadmap_1214_li
Index usage for REGEXP LIKE. Index usage for REGEXP LIKE.
...@@ -8099,7 +8123,7 @@ Better support multiple processors for in-memory databases. ...@@ -8099,7 +8123,7 @@ Better support multiple processors for in-memory databases.
Access rights: remember the owner of an object. COMMENT: allow owner of object to change it. Access rights: remember the owner of an object. COMMENT: allow owner of object to change it.
@roadmap_1218_li @roadmap_1218_li
Access rights: Finer grained access control (grant access for specific functions) Access rights: finer grained access control (grant access for specific functions)
@roadmap_1219_li @roadmap_1219_li
Support N'text' Support N'text'
...@@ -8153,7 +8177,7 @@ Support Oracle functions: TRUNC, NVL2, TO_CHAR, TO_DATE, TO_NUMBER ...@@ -8153,7 +8177,7 @@ Support Oracle functions: TRUNC, NVL2, TO_CHAR, TO_DATE, TO_NUMBER
Sequence: PostgreSQL compatibility (rename, create) (http://www.postgresql.org/docs/8.2/static/sql-altersequence.html) Sequence: PostgreSQL compatibility (rename, create) (http://www.postgresql.org/docs/8.2/static/sql-altersequence.html)
@roadmap_1236_li @roadmap_1236_li
DISTINCT: Support large result sets by sorting on all columns (additionally) and then removing duplicates. DISTINCT: support large result sets by sorting on all columns (additionally) and then removing duplicates.
@roadmap_1237_li @roadmap_1237_li
File system that writes to two file systems (replicating file system) File system that writes to two file systems (replicating file system)
...@@ -8180,7 +8204,7 @@ Integrate spatial functions from http://geosysin.iict.ch/irstv-trac/wiki/H2spati ...@@ -8180,7 +8204,7 @@ Integrate spatial functions from http://geosysin.iict.ch/irstv-trac/wiki/H2spati
Support COSH, SINH, and TANH functions Support COSH, SINH, and TANH functions
@roadmap_1245_li @roadmap_1245_li
FTP Server: Implement SFTP / FTPS FTP Server: implement SFTP / FTPS
@roadmap_1246_li @roadmap_1246_li
Native search: support "phrase search", wildcard search (* and ?), case-insensitive search, boolean operators, and grouping Native search: support "phrase search", wildcard search (* and ?), case-insensitive search, boolean operators, and grouping
...@@ -8240,408 +8264,411 @@ Web site design: http://www.igniterealtime.org/projects/openfire/index.jsp ...@@ -8240,408 +8264,411 @@ Web site design: http://www.igniterealtime.org/projects/openfire/index.jsp
HSQLDB compatibility: Openfire server uses: CREATE SCHEMA PUBLIC AUTHORIZATION DBA; CREATE USER SA PASSWORD ""; GRANT DBA TO SA; SET SCHEMA PUBLIC HSQLDB compatibility: Openfire server uses: CREATE SCHEMA PUBLIC AUTHORIZATION DBA; CREATE USER SA PASSWORD ""; GRANT DBA TO SA; SET SCHEMA PUBLIC
@roadmap_1265_li @roadmap_1265_li
Web site: Rename Performance to Comparison [/Compatibility], move Comparison to Other Database Engines to Comparison, move Products that Work with H2 to Comparison, move Performance Tuning to Advanced Topics Translation: use ?? in help.csv
@roadmap_1266_li @roadmap_1266_li
Translation: use ?? in help.csv Translated .pdf
@roadmap_1267_li @roadmap_1267_li
Translated .pdf Cluster: hot deploy (adding a node at runtime)
@roadmap_1268_li @roadmap_1268_li
Cluster: hot deploy (adding a node at runtime) MySQL compatibility: update test1 t1, test2 t2 set t1.id = t2.id where t1.id = t2.id;
@roadmap_1269_li @roadmap_1269_li
MySQL compatibility: update test1 t1, test2 t2 set t1.id = t2.id where t1.id = t2.id; Recovery tool: bad blocks should be converted to INSERT INTO SYSTEM_ERRORS(...), and things should go into the .trace.db file
@roadmap_1270_li @roadmap_1270_li
Recovery tool: bad blocks should be converted to INSERT INTO SYSTEM_ERRORS(...), and things should go into the .trace.db file RECOVER=2 to backup the database, run recovery, open the database
@roadmap_1271_li @roadmap_1271_li
RECOVER=2 to backup the database, run recovery, open the database Recovery should work with encrypted databases
@roadmap_1272_li @roadmap_1272_li
Recovery should work with encrypted databases Corruption: new error code, add help
@roadmap_1273_li @roadmap_1273_li
Corruption: new error code, add help Space reuse: after init, scan all storages and free those that don't belong to a live database object
@roadmap_1274_li @roadmap_1274_li
Space reuse: after init, scan all storages and free those that don't belong to a live database object SysProperties: change everything to H2_...
@roadmap_1275_li @roadmap_1275_li
SysProperties: change everything to H2_... Use FilterIn / FilterOut putStream?
@roadmap_1276_li @roadmap_1276_li
Use FilterIn / FilterOut putStream? Access rights: add missing features (users should be 'owner' of objects; missing rights for sequences; dropping objects)
@roadmap_1277_li @roadmap_1277_li
Access rights: add missing features (users should be 'owner' of objects; missing rights for sequences; dropping objects) Support NOCACHE table option (Oracle)
@roadmap_1278_li @roadmap_1278_li
Support NOCACHE table option (Oracle) Support table partitioning.
@roadmap_1279_li @roadmap_1279_li
Support table partitioning. Index usage for UPDATE ... WHERE .. IN (SELECT...)
@roadmap_1280_li @roadmap_1280_li
Index usage for UPDATE ... WHERE .. IN (SELECT...) Add regular javadocs (using the default doclet, but another css) to the homepage.
@roadmap_1281_li @roadmap_1281_li
Add regular javadocs (using the default doclet, but another css) to the homepage. The database should be kept open for a longer time when using the server mode.
@roadmap_1282_li @roadmap_1282_li
The database should be kept open for a longer time when using the server mode. Javadocs: for each tool, add a copy &amp; paste sample in the class level.
@roadmap_1283_li @roadmap_1283_li
Javadocs: for each tool, add a copy &amp; paste sample in the class level. Javadocs: add @author tags.
@roadmap_1284_li @roadmap_1284_li
Javadocs: add @author tags. Fluent API for tools: Server.createTcpServer().setPort(9081).setPassword(password).start();
@roadmap_1285_li @roadmap_1285_li
Fluent API for tools: Server.createTcpServer().setPort(9081).setPassword(password).start(); MySQL compatibility: real SQL statement for DESCRIBE TEST
@roadmap_1286_li @roadmap_1286_li
MySQL compatibility: real SQL statement for DESCRIBE TEST Use a default delay of 1 second before closing a database.
@roadmap_1287_li @roadmap_1287_li
Use a default delay of 1 second before closing a database. Write (log) to system table before adding to internal data structures.
@roadmap_1288_li @roadmap_1288_li
Write (log) to system table before adding to internal data structures. Support very large deletes and updates.
@roadmap_1289_li @roadmap_1289_li
Support very large deletes and updates. Doclet (javadocs): constructors are not listed.
@roadmap_1290_li @roadmap_1290_li
Doclet (javadocs): constructors are not listed. Support direct lookup for MIN and MAX when using WHERE (see todo.txt / Direct Lookup).
@roadmap_1291_li @roadmap_1291_li
Support direct lookup for MIN and MAX when using WHERE (see todo.txt / Direct Lookup). Support other array types (String[], double[]) in PreparedStatement.setObject(int, Object);
@roadmap_1292_li @roadmap_1292_li
Support other array types (String[], double[]) in PreparedStatement.setObject(int, Object); MVCC should not be memory bound (uncommitted data is kept in memory in the delta index; maybe using a regular btree index solves the problem).
@roadmap_1293_li @roadmap_1293_li
MVCC should not be memory bound (uncommitted data is kept in memory in the delta index; maybe using a regular btree index solves the problem). Oracle compatibility: support NLS_DATE_FORMAT.
@roadmap_1294_li @roadmap_1294_li
Oracle compatibility: support NLS_DATE_FORMAT. Support flashback queries as in Oracle.
@roadmap_1295_li @roadmap_1295_li
Support flashback queries as in Oracle. Import / Export of fixed with text files.
@roadmap_1296_li @roadmap_1296_li
Import / Export of fixed with text files. Support OUT parameters in user-defined procedures.
@roadmap_1297_li @roadmap_1297_li
Support OUT parameters in user-defined procedures. Support getGeneratedKeys to return multiple rows when used with batch updates. This is supported by MySQL, but not Derby. Both PostgreSQL and HSQLDB don't support getGeneratedKeys. Also support it when using INSERT ... SELECT.
@roadmap_1298_li @roadmap_1298_li
Support getGeneratedKeys to return multiple rows when used with batch updates. This is supported by MySQL, but not Derby. Both PostgreSQL and HSQLDB don't support getGeneratedKeys. Also support it when using INSERT ... SELECT. HSQLDB compatibility: automatic data type for SUM if value is the value is too big (by default use the same type as the data).
@roadmap_1299_li @roadmap_1299_li
HSQLDB compatibility: automatic data type for SUM if value is the value is too big (by default use the same type as the data). Improve the optimizer to select the right index for special cases: where id between 2 and 4 and booleanColumn
@roadmap_1300_li @roadmap_1300_li
Improve the optimizer to select the right index for special cases: where id between 2 and 4 and booleanColumn Linked tables: make hidden columns available (Oracle: rowid and ora_rowscn columns).
@roadmap_1301_li @roadmap_1301_li
Linked tables: make hidden columns available (Oracle: rowid and ora_rowscn columns). Support merge join.
@roadmap_1302_li @roadmap_1302_li
Support merge join. H2 Console: in-place autocomplete.
@roadmap_1303_li @roadmap_1303_li
H2 Console: in-place autocomplete. Oracle: support DECODE method (convert to CASE WHEN).
@roadmap_1304_li @roadmap_1304_li
Oracle: support DECODE method (convert to CASE WHEN). Support large databases: split LOB (BLOB, CLOB) to multiple directories / disks (similar to tablespaces).
@roadmap_1305_li @roadmap_1305_li
Support large databases: split LOB (BLOB, CLOB) to multiple directories / disks (similar to tablespaces). Support to assign a primary key index a user defined name.
@roadmap_1306_li @roadmap_1306_li
Support to assign a primary key index a user defined name. Cluster: add feature to make sure cluster nodes can not get out of sync (for example by stopping one process).
@roadmap_1307_li @roadmap_1307_li
Cluster: Add feature to make sure cluster nodes can not get out of sync (for example by stopping one process). H2 Console: support configuration option for fixed width (monospace) font.
@roadmap_1308_li @roadmap_1308_li
H2 Console: support configuration option for fixed width (monospace) font. Native fulltext search: support analyzers (specially for Chinese, Japanese).
@roadmap_1309_li @roadmap_1309_li
Native fulltext search: support analyzers (specially for Chinese, Japanese). Automatically compact databases from time to time (as a background process).
@roadmap_1310_li @roadmap_1310_li
Automatically compact databases from time to time (as a background process). Support SCOPE_IDENTITY().
@roadmap_1311_li @roadmap_1311_li
Support SCOPE_IDENTITY(). Support GRANT SELECT, UPDATE ON *.
@roadmap_1312_li @roadmap_1312_li
Support GRANT SELECT, UPDATE ON *. Test Eclipse DTP.
@roadmap_1313_li @roadmap_1313_li
Test Eclipse DTP. H2 Console: autocomplete: keep the previous setting
@roadmap_1314_li @roadmap_1314_li
H2 Console: autocomplete: keep the previous setting MySQL, MS SQL Server compatibility: support case sensitive (mixed case) identifiers without quotes.
@roadmap_1315_li @roadmap_1315_li
MySQL, MS SQL Server compatibility: support case sensitive (mixed case) identifiers without quotes. executeBatch: option to stop at the first failed statement.
@roadmap_1316_li @roadmap_1316_li
executeBatch: option to stop at the first failed statement. Implement OLAP features as described here: http://www.devx.com/getHelpOn/10MinuteSolution/16573/0/page/5
@roadmap_1317_li @roadmap_1317_li
Implement OLAP features as described here: http://www.devx.com/getHelpOn/10MinuteSolution/16573/0/page/5 Support Oracle ROWID (unique identifier for each row).
@roadmap_1318_li @roadmap_1318_li
Support Oracle ROWID (unique identifier for each row). Server mode: improve performance for batch updates.
@roadmap_1319_li @roadmap_1319_li
Server mode: Improve performance for batch updates. Applets: support read-only databases in a zip file (accessed as a resource).
@roadmap_1320_li @roadmap_1320_li
Applets: Support read-only databases in a zip file (accessed as a resource). Long running queries / errors / trace system table.
@roadmap_1321_li @roadmap_1321_li
Long running queries / errors / trace system table. H2 Console should support JaQu directly.
@roadmap_1322_li @roadmap_1322_li
H2 Console should support JaQu directly. H2 Console: support single file upload and directory download (optional).
@roadmap_1323_li @roadmap_1323_li
H2 Console: support single file upload and directory download (optional). Document FTL_SEARCH, FTL_SEARCH_DATA.
@roadmap_1324_li @roadmap_1324_li
Document FTL_SEARCH, FTL_SEARCH_DATA. Sequences: CURRVAL should be session specific. Compatibility with PostgreSQL.
@roadmap_1325_li @roadmap_1325_li
Sequences: CURRVAL should be session specific. Compatibility with PostgreSQL. Support DatabaseMetaData.insertsAreDetected: updatable result sets should detect inserts.
@roadmap_1326_li @roadmap_1326_li
Support DatabaseMetaData.insertsAreDetected: updatable result sets should detect inserts. Auto-server: add option to define the IP address range or list.
@roadmap_1327_li @roadmap_1327_li
Auto-server: add option to define the IP address range or list. Index creation only using deterministic functions.
@roadmap_1328_li @roadmap_1328_li
Index creation only using deterministic functions. Use http://recaptcha.net somehow to secure the Google Group.
@roadmap_1329_li @roadmap_1329_li
Use http://recaptcha.net somehow to secure the Google Group. Support DELETE with TOP or LIMIT. See also: http://dev.mysql.com/doc/refman/5.1/de/delete.html
@roadmap_1330_li @roadmap_1330_li
Support DELETE with TOP or LIMIT. See also: http://dev.mysql.com/doc/refman/5.1/de/delete.html Change the default for NULL || 'x' to return NULL
@roadmap_1331_li @roadmap_1331_li
Change the default for NULL || 'x' to return NULL ANALYZE: use a bloom filter for each indexed column to estimate count of distinct values.
@roadmap_1332_li @roadmap_1332_li
ANALYZE: Use a bloom filter for each indexed column to estimate count of distinct values. ANALYZE: for unique indexes that allow null, count the number of null.
@roadmap_1333_li @roadmap_1333_li
ANALYZE: For unique indexes that allow null, count the number of null. AUTO_SERVER: support changing IP addresses (disable a network while the database is open).
@roadmap_1334_li @roadmap_1334_li
AUTO_SERVER: support changing IP addresses (disable a network while the database is open). Avoid using java.util.Calendar internally because it's slow, complicated, and seems to be buggy.
@roadmap_1335_li @roadmap_1335_li
Avoid using java.util.Calendar internally because it's slow, complicated, and seems to be buggy. Support TRUNCATE .. CASCADE like PostgreSQL.
@roadmap_1336_li @roadmap_1336_li
Support TRUNCATE .. CASCADE like PostgreSQL. Support opening a database that is in the classpath, maybe using a new file system.
@roadmap_1337_li @roadmap_1337_li
Support opening a database that is in the classpath, maybe using a new file system. Fulltext search: lazy result generation using SimpleRowSource.
@roadmap_1338_li @roadmap_1338_li
Fulltext search: lazy result generation using SimpleRowSource. Support transformation to join for user defined functions, as for IN(SELECT...).
@roadmap_1339_li @roadmap_1339_li
Support transformation to join for user defined functions, as for IN(SELECT...). Fulltext search: support alternative syntax: WHERE FTL_CONTAINS(name, 'hello').
@roadmap_1340_li @roadmap_1340_li
Fulltext search: Support alternative syntax: WHERE FTL_CONTAINS(name, 'hello'). MySQL compatibility: support REPLACE, see http://dev.mysql.com/doc/refman/5.1/de/replace.html
@roadmap_1341_li @roadmap_1341_li
MySQL compatibility: support REPLACE, see http://dev.mysql.com/doc/refman/5.1/de/replace.html MySQL compatibility: support INSERT INTO table SET column1 = value1, column2 = value2
@roadmap_1342_li @roadmap_1342_li
MySQL compatibility: support INSERT INTO table SET column1 = value1, column2 = value2 Docs: add a one line description for each functions and SQL statements at the top (in the link section).
@roadmap_1343_li @roadmap_1343_li
Docs: Add a one line description for each functions and SQL statements at the top (in the link section). Javadoc search: weight for titles should be higher ('random' should list Functions as the best match).
@roadmap_1344_li @roadmap_1344_li
Javadoc search: weight for titles should be higher ('random' should list Functions as the best match). Replace information_schema tables with regular tables that are automatically re-built when needed. Use indexes.
@roadmap_1345_li @roadmap_1345_li
Replace information_schema tables with regular tables that are automatically re-built when needed. Use indexes. Support a special trigger on all tables.
@roadmap_1346_li @roadmap_1346_li
Support a special trigger on all tables. Delete temporary files or objects using finalize.
@roadmap_1347_li @roadmap_1347_li
Delete temporary files or objects using finalize. Oracle compatibility: support calling 0-parameters functions without parenthesis. Make constants obsolete.
@roadmap_1348_li @roadmap_1348_li
Oracle compatibility: support calling 0-parameters functions without parenthesis. Make constants obsolete. MySQL, HSQLDB compatibility: support where 'a'=1 (not supported by Derby, PostgreSQL)
@roadmap_1349_li @roadmap_1349_li
MySQL, HSQLDB compatibility: support where 'a'=1 (not supported by Derby, PostgreSQL) Allow calling function with no parameters without parenthesis. See http://code.google.com/p/h2database/issues/detail?id=50
@roadmap_1350_li @roadmap_1350_li
Allow calling function with no parameters without parenthesis. See http://code.google.com/p/h2database/issues/detail?id=50 CSV: currently # is a line comment and can start at any field. Make it optional.
@roadmap_1351_li @roadmap_1351_li
CSV: currently # is a line comment and can start at any field. Make it optional. Add database creation date and time to the database.
@roadmap_1352_li @roadmap_1352_li
Add database creation date and time to the database. Support ASSERTIONS.
@roadmap_1353_li @roadmap_1353_li
Support ASSERTIONS. MySQL compatibility: support comparing 1='a'
@roadmap_1354_li @roadmap_1354_li
MySQL compatibility: support comparing 1='a' Support PostgreSQL lock modes: http://www.postgresql.org/docs/8.3/static/explicit-locking.html
@roadmap_1355_li @roadmap_1355_li
Support PostgreSQL lock modes: http://www.postgresql.org/docs/8.3/static/explicit-locking.html PostgreSQL compatibility: test DbVisualizer and Squirrel SQL using a new PostgreSQL JDBC driver.
@roadmap_1356_li @roadmap_1356_li
PostgreSQL compatibility: test DbVisualizer and Squirrel SQL using a new PostgreSQL JDBC driver. RunScript should be able to read from system in (or quite mode for Shell).
@roadmap_1357_li @roadmap_1357_li
RunScript should be able to read from system in (or quite mode for Shell). Natural join: support select x from dual natural join dual.
@roadmap_1358_li @roadmap_1358_li
Natural join: support select x from dual natural join dual. Natural join: somehow support this: select a.x, b.x, x from dual a natural join dual b
@roadmap_1359_li @roadmap_1359_li
Natural join: somehow support this: select a.x, b.x, x from dual a natural join dual b MySQL compatibility: for auto_increment columns, convert 0 to next value (as when inserting NULL).
@roadmap_1360_li @roadmap_1360_li
MySQL compatibility: for auto_increment columns, convert 0 to next value (as when inserting NULL). Functions: support hashcode(value); cryptographic and fast
@roadmap_1361_li @roadmap_1361_li
Functions: support hashcode(value); cryptographic and fast Serialized file lock: support long running queries.
@roadmap_1362_li @roadmap_1362_li
Serialized file lock: support long running queries. Network: use 127.0.0.1 if other addresses don't work.
@roadmap_1363_li @roadmap_1363_li
Network: use 127.0.0.1 if other addresses don't work. Select for update in mvcc mode: only lock the selected records.
@roadmap_1364_li @roadmap_1364_li
Select for update in mvcc mode: only lock the selected records. Support reading JCR data: one table per node type; query table; cache option
@roadmap_1365_li @roadmap_1365_li
Support reading JCR data: one table per node type; query table; cache option OSGi: create a sample application, test, document.
@roadmap_1366_li @roadmap_1366_li
OSGi: create a sample application, test, document. help.csv: use complete examples for functions; run as test case.
@roadmap_1367_li @roadmap_1367_li
help.csv: use complete examples for functions; run as test case. Re-implement PooledConnection; use a lightweight connection object.
@roadmap_1368_li @roadmap_1368_li
Re-implement PooledConnection; use a lightweight connection object. Doclet: convert tests in javadocs to a java class.
@roadmap_1369_li @roadmap_1369_li
Doclet: convert tests in javadocs to a java class. Doclet: format fields like methods, but support sorting by name and value.
@roadmap_1370_li @roadmap_1370_li
Doclet: format fields like methods, but support sorting by name and value. Doclet: shrink the html files.
@roadmap_1371_li @roadmap_1371_li
Doclet: shrink the html files. Finer granularity for SLF4J trace - See http://code.google.com/p/h2database/issues/detail?id=62
@roadmap_1372_li @roadmap_1372_li
Finer granularity for SLF4J trace - See http://code.google.com/p/h2database/issues/detail?id=62 MySQL compatibility: support REPLACE - See http://code.google.com/p/h2database/issues/detail?id=73
@roadmap_1373_li @roadmap_1373_li
MySQL compatibility: support REPLACE - See http://code.google.com/p/h2database/issues/detail?id=73 MySQL compatibility: support SET NAMES 'latin1' - See also http://code.google.com/p/h2database/issues/detail?id=56
@roadmap_1374_li @roadmap_1374_li
MySQL compatibility: support SET NAMES 'latin1' - See also http://code.google.com/p/h2database/issues/detail?id=56 MySQL compatibility: DELETE .. FROM .. USING - See http://dev.mysql.com/doc/refman/5.0/en/delete.html
@roadmap_1375_li @roadmap_1375_li
MySQL compatibility: DELETE .. FROM .. USING - See http://dev.mysql.com/doc/refman/5.0/en/delete.html Allow to scan index backwards starting with a value (to better support ORDER BY DESC).
@roadmap_1376_li @roadmap_1376_li
Allow to scan index backwards starting with a value (to better support ORDER BY DESC). Java Service Wrapper: try http://yajsw.sourceforge.net/
@roadmap_1377_li @roadmap_1377_li
Java Service Wrapper: try http://yajsw.sourceforge.net/ Batch parameter for INSERT, UPDATE, and DELETE, and commit after each batch. See also MySQL DELETE.
@roadmap_1378_li @roadmap_1378_li
Batch parameter for INSERT, UPDATE, and DELETE, and commit after each batch. See also MySQL DELETE. MySQL compatibility: support ALTER TABLE .. MODIFY COLUMN.
@roadmap_1379_li @roadmap_1379_li
MySQL compatibility: support ALTER TABLE .. MODIFY COLUMN. Use a lazy and auto-close input stream (open resource when reading, close on eof).
@roadmap_1380_li @roadmap_1380_li
Use a lazy and auto-close input stream (open resource when reading, close on eof). PostgreSQL compatibility: generate_series.
@roadmap_1381_li @roadmap_1381_li
PostgreSQL compatibility: generate_series. Connection pool: 'reset session' command (delete temp tables, rollback, autocommit true).
@roadmap_1382_li @roadmap_1382_li
Connection pool: 'reset session' command (delete temp tables, rollback, autocommit true). Improve SQL documentation, see http://www.w3schools.com/sql/
@roadmap_1383_li @roadmap_1383_li
Improve SQL documentation, see http://www.w3schools.com/sql/ MySQL compatibility: DatabaseMetaData.stores*() methods should return the same values. Test with SquirrelSQL.
@roadmap_1384_li @roadmap_1384_li
MySQL compatibility: DatabaseMetaData.stores*() methods should return the same values. Test with SquirrelSQL. MS SQL Server compatibility: support DATEPART syntax.
@roadmap_1385_li @roadmap_1385_li
MS SQL Server compatibility: support DATEPART syntax. Oracle compatibility: support CREATE OR REPLACE VIEW syntax.
@roadmap_1386_li @roadmap_1386_li
Oracle compatibility: support CREATE OR REPLACE VIEW syntax. Sybase/DB2/Oracle compatibility: support out parameters in stored procedures - See http://code.google.com/p/h2database/issues/detail?id=83
@roadmap_1387_li @roadmap_1387_li
Sybase/DB2/Oracle compatibility: support out parameters in stored procedures - See http://code.google.com/p/h2database/issues/detail?id=83 Support INTERVAL data type (see Oracle and others).
@roadmap_1388_li @roadmap_1388_li
Support INTERVAL data type (see Oracle and others). Combine Server and Console tool (only keep Server).
@roadmap_1389_li @roadmap_1389_li
Combine Server and Console tool (only keep Server). Store the Lucene index in the database itself.
@roadmap_1390_li @roadmap_1390_li
Store the Lucene index in the database itself. Oracle compatibility: support DECODE(x, ...).
@roadmap_1391_li @roadmap_1391_li
Oracle compatibility: support DECODE(x, ...). Console: Start Browser: if ip number changed, try localhost instead.
@roadmap_1392_li @roadmap_1392_li
Console: Start Browser: if ip number changed, try localhost instead. MVCC: compare concurrent update behavior with PostgreSQL and Oracle.
@roadmap_1393_li @roadmap_1393_li
MVCC: compare concurrent update behavior with PostgreSQL and Oracle. HSQLDB compatibility: CREATE FUNCTION (maybe using a Function interface).
@roadmap_1394_li @roadmap_1394_li
HSQLDB compatibility: CREATE FUNCTION (maybe using a Function interface). HSQLDB compatibility: support CALL "java.lang.Math.sqrt"(2.0)
@roadmap_1395_li @roadmap_1395_li
HSQLDB compatibility: support CALL "java.lang.Math.sqrt"(2.0) Support comma as the decimal separator in the CSV tool.
@roadmap_1396_li @roadmap_1396_li
Support comma as the decimal separator in the CSV tool. Compatibility: Java functions with SQLJ Part1 http://www.acm.org/sigmod/record/issues/9912/standards.pdf.gz
@roadmap_1397_li
Compatibility: Java functions with SQL/PSM (Persistent Stored Modules) - need to find the documentation.
@roadmap_1397_h2 @roadmap_1398_h2
Not Planned Not Planned
@roadmap_1398_li @roadmap_1399_li
HSQLDB (did) support this: select id i from test where i&lt;0 (other databases don't). Supporting it may break compatibility. HSQLDB (did) support this: select id i from test where i&lt;0 (other databases don't). Supporting it may break compatibility.
@roadmap_1399_li @roadmap_1400_li
String.intern (so that Strings can be compared with ==) will not be used because some VMs have problems when used extensively. String.intern (so that Strings can be compared with ==) will not be used because some VMs have problems when used extensively.
@sourceError_1000_h1 @sourceError_1000_h1
...@@ -8855,7 +8882,7 @@ Error messages in are shown in red. You can show/hide the stack trace of the exc ...@@ -8855,7 +8882,7 @@ Error messages in are shown in red. You can show/hide the stack trace of the exc
Adding Database Drivers Adding Database Drivers
@tutorial_1057_p @tutorial_1057_p
Additional database drivers can be registered by adding the Jar file location of the driver to the environment variables H2DRIVERS or CLASSPATH. Example (Windows): To add the database driver library C:\Programs\hsqldb\lib\hsqldb.jar, set the environment variable H2DRIVERS to C:\Programs\hsqldb\lib\hsqldb.jar. Additional database drivers can be registered by adding the Jar file location of the driver to the environment variables H2DRIVERS or CLASSPATH. Example (Windows): to add the database driver library C:\Programs\hsqldb\lib\hsqldb.jar, set the environment variable H2DRIVERS to C:\Programs\hsqldb\lib\hsqldb.jar.
@tutorial_1058_p @tutorial_1058_p
Multiple drivers can be set; each entry needs to be separated with a ';' (Windows) or ':' (other operating systems). Spaces in the path names are supported. The settings must not be quoted. Multiple drivers can be set; each entry needs to be separated with a ';' (Windows) or ':' (other operating systems). Spaces in the path names are supported. The settings must not be quoted.
......
...@@ -125,7 +125,7 @@ Result Sets ...@@ -125,7 +125,7 @@ Result Sets
#To view the statements that are executed against the target table, set the trace level to 3. #To view the statements that are executed against the target table, set the trace level to 3.
@advanced_1042_p @advanced_1042_p
#There is a restriction: When inserting into a linked table, and when updating a linked table, NULL and values that are not set are both inserted as NULL. This may not have the desired effect if the default value for this column in the target table is not NULL. #There is a restriction: when inserting into a linked table, and when updating a linked table, NULL and values that are not set are both inserted as NULL. This may not have the desired effect if the default value for this column in the target table is not NULL.
@advanced_1043_p @advanced_1043_p
#If multiple linked tables point to the same database (using the same database URL), the connection is shared. To disable this, set the system property h2.shareLinkedConnections to false. #If multiple linked tables point to the same database (using the same database URL), the connection is shared. To disable this, set the system property h2.shareLinkedConnections to false.
...@@ -568,16 +568,16 @@ ACID ...@@ -568,16 +568,16 @@ ACID
データベースの世界では、ACIDとは以下を表しています: データベースの世界では、ACIDとは以下を表しています:
@advanced_1189_li @advanced_1189_li
Atomicity (原子性) : トランザクションはアトミックでなければならず、全てのタスクが実行されたか、実行されないかの どちらかであるという意味です。 #Atomicity: transactions must be atomic, meaning either all tasks are performed or none.
@advanced_1190_li @advanced_1190_li
Consistency (一貫性) : 全てのオペレーションは定義された制約に従わなくてはいけません。 #Consistency: all operations must comply with the defined constraints.
@advanced_1191_li @advanced_1191_li
Isolation (独立性 / 分離性) : トランザクションはそれぞれ独立 (隔離) されていなくてはなりません。 #Isolation: transactions must be isolated from each other.
@advanced_1192_li @advanced_1192_li
Durability (永続性) : コミットされたトランザクションは失われません。 #Durability: committed transaction will not be lost.
@advanced_1193_h3 @advanced_1193_h3
Atomicity (原子性) Atomicity (原子性)
...@@ -616,10 +616,10 @@ Durability (永続性) ...@@ -616,10 +616,10 @@ Durability (永続性)
失われなかったコミット済みトランザクションは、最初に思うよりもより複雑だということを理解して下さい。 完全な永続性を保障するためには、データベースは、コミットの呼び出しが返ってくる前に ログレコードがハードドライブ上にあることを確実にしなければなりません。 これを行うために、データベースは異なったメソッドを使用します。ひとつは "同期書き込み" ファイルアクセスモードを使用することです。Javaでは、RandomAccessFile はモード "rws" と "rwd" を サポートしています: 失われなかったコミット済みトランザクションは、最初に思うよりもより複雑だということを理解して下さい。 完全な永続性を保障するためには、データベースは、コミットの呼び出しが返ってくる前に ログレコードがハードドライブ上にあることを確実にしなければなりません。 これを行うために、データベースは異なったメソッドを使用します。ひとつは "同期書き込み" ファイルアクセスモードを使用することです。Javaでは、RandomAccessFile はモード "rws" と "rwd" を サポートしています:
@advanced_1205_li @advanced_1205_li
rwd: それぞれのファイル内容の更新は、元になるストレージデバイスと同時に書き込まれます。 #rwd: every update to the file's content is written synchronously to the underlying storage device.
@advanced_1206_li @advanced_1206_li
rws: rwdに加えて、それぞれのメタデータの更新は同時に書き込まれます。 #rws: in addition to rwd, every update to the metadata is written synchronously.
@advanced_1207_p @advanced_1207_p
#A test (org.h2.test.poweroff.TestWrite) with one of those modes achieves around 50 thousand write operations per second. Even when the operating system write buffer is disabled, the write rate is around 50 thousand operations per second. This feature does not force changes to disk because it does not flush all buffers. The test updates the same byte in the file again and again. If the hard drive was able to write at this rate, then the disk would need to make at least 50 thousand revolutions per second, or 3 million RPM (revolutions per minute). There are no such hard drives. The hard drive used for the test is about 7200 RPM, or about 120 revolutions per second. There is an overhead, so the maximum write rate must be lower than that. #A test (org.h2.test.poweroff.TestWrite) with one of those modes achieves around 50 thousand write operations per second. Even when the operating system write buffer is disabled, the write rate is around 50 thousand operations per second. This feature does not force changes to disk because it does not flush all buffers. The test updates the same byte in the file again and again. If the hard drive was able to write at this rate, then the disk would need to make at least 50 thousand revolutions per second, or 3 million RPM (revolutions per minute). There are no such hard drives. The hard drive used for the test is about 7200 RPM, or about 120 revolutions per second. There is an overhead, so the maximum write rate must be lower than that.
...@@ -790,7 +790,7 @@ ZERO() 関数を使用する ...@@ -790,7 +790,7 @@ ZERO() 関数を使用する
ハッシュ値の結果は、ブロック暗号アルゴリズム (AES-128、または 32ラウンドのXTEA) のためのキーとして 使用されます。その時、初期化ベクター (IV) キーは、再びSHA-256を使用してキーをハッシュ化することによって 計算されます。IVはアタッカーに知らないということを確認して下さい。秘密のIVを使用する理由は、 ウォーターマークアタック (電子透かし攻撃) を防御するためです。 ハッシュ値の結果は、ブロック暗号アルゴリズム (AES-128、または 32ラウンドのXTEA) のためのキーとして 使用されます。その時、初期化ベクター (IV) キーは、再びSHA-256を使用してキーをハッシュ化することによって 計算されます。IVはアタッカーに知らないということを確認して下さい。秘密のIVを使用する理由は、 ウォーターマークアタック (電子透かし攻撃) を防御するためです。
@advanced_1263_p @advanced_1263_p
データのブロックを保存する前に (それぞれのブロックは 8 バイト長)、次のオペレーションを 実行します: 最初に、IVはIVキー (同じblock cipher algorithmを使用して) でブロックナンバーを 暗号化することによって計算されます。このIVはXORを使用してプレーンテキストと併用されます。 結果データはAES-128、またはXTEAアルゴリズムを使用して暗号化されます。 #Before saving a block of data (each block is 8 bytes long), the following operations are executed: first, the IV is calculated by encrypting the block number with the IV key (using the same block cipher algorithm). This IV is combined with the plain text using XOR. The resulting data is encrypted using the AES-128 or XTEA algorithm.
@advanced_1264_p @advanced_1264_p
復号化の時、オペレーションは反対に行われます。最初に、ブロックはキーを使用して復号化され、 その時、IVはXORを使用して復号化テキストと併用されます。 復号化の時、オペレーションは反対に行われます。最初に、ブロックはキーを使用して復号化され、 その時、IVはXORを使用して復号化テキストと併用されます。
...@@ -841,7 +841,7 @@ SSL/TLS 接続 ...@@ -841,7 +841,7 @@ SSL/TLS 接続
いくつかの値は: いくつかの値は:
@advanced_1280_p @advanced_1280_p
人の隕石に衝突するという年に一度の危険性は、170億に一回と見積もられ、それは、確率がおよそ 0.000'000'000'06 だということを意味しています。 #To help non-mathematicians understand what those numbers mean, here a comparison: one's annual risk of being hit by a meteorite is estimated to be one chance in 17 billion, that means the probability is about 0.000'000'000'06.
@advanced_1281_h2 @advanced_1281_h2
システムプロパティから読み込まれた設定 システムプロパティから読み込まれた設定
...@@ -868,7 +868,7 @@ SSL/TLS 接続 ...@@ -868,7 +868,7 @@ SSL/TLS 接続
#This database has the following known limitations: #This database has the following known limitations:
@advanced_1289_li @advanced_1289_li
#The maximum file size is currently 256 GB for the data, and 256 GB for the index. This number is excluding BLOB and CLOB data: Every CLOB or BLOB can be up to 256 GB as well. #The maximum file size is currently 256 GB for the data, and 256 GB for the index. This number is excluding BLOB and CLOB data: every CLOB or BLOB can be up to 256 GB as well.
@advanced_1290_li @advanced_1290_li
#The maximum file size for FAT or FAT32 file systems is 4 GB. That means when using FAT or FAT32, the limit is 4 GB for the data. This is the limitation of the file system. The database does provide a workaround for this problem, it is to use the file name prefix 'split:'. In that case files are split into files of 1 GB by default. An example database URL is: <code>jdbc:h2:split:~/test</code> . #The maximum file size for FAT or FAT32 file systems is 4 GB. That means when using FAT or FAT32, the limit is 4 GB for the data. This is the limitation of the file system. The database does provide a workaround for this problem, it is to use the file name prefix 'split:'. In that case files are split into files of 1 GB by default. An example database URL is: <code>jdbc:h2:split:~/test</code> .
...@@ -1066,16 +1066,16 @@ Maven 2 の利用 ...@@ -1066,16 +1066,16 @@ Maven 2 の利用
#The build system can generate smaller jar files as well. The following targets are currently supported: #The build system can generate smaller jar files as well. The following targets are currently supported:
@build_1032_li @build_1032_li
#jarClient: Create the h2client.jar. This only contains the JDBC client. #jarClient creates the h2client.jar. This only contains the JDBC client.
@build_1033_li @build_1033_li
#jarSmall: Create the file h2small.jar. This only contains the embedded database. Debug information is disabled. #jarSmall creates the file h2small.jar. This only contains the embedded database. Debug information is disabled.
@build_1034_li @build_1034_li
#jarJaqu: Create the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu. #jarJaqu creates the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu.
@build_1035_li @build_1035_li
#javadocImpl: Create the Javadocs of the implementation. #javadocImpl creates the Javadocs of the implementation.
@build_1036_p @build_1036_p
#To create the h2client.jar file, go to the directory h2 and execute the following command: #To create the h2client.jar file, go to the directory h2 and execute the following command:
...@@ -1138,7 +1138,7 @@ Centralリポジトリの利用 ...@@ -1138,7 +1138,7 @@ Centralリポジトリの利用
#The test cases should cover at least 90% of the changed and new code; use a code coverage tool to verify that (see above). or use the build target 'coverage'. #The test cases should cover at least 90% of the changed and new code; use a code coverage tool to verify that (see above). or use the build target 'coverage'.
@build_1056_li @build_1056_li
#Verify that you did not break other features: Run the test cases by executing <code>build test</code> . #Verify that you did not break other features: run the test cases by executing <code>build test</code> .
@build_1057_li @build_1057_li
#Provide end user documentation if required ( <code>src/docsrc/html/*</code> ). #Provide end user documentation if required ( <code>src/docsrc/html/*</code> ).
...@@ -1282,7 +1282,7 @@ Centralリポジトリの利用 ...@@ -1282,7 +1282,7 @@ Centralリポジトリの利用
#ResultSetMetaData.getColumnClassName returned the wrong class for CLOB and BLOB columns. #ResultSetMetaData.getColumnClassName returned the wrong class for CLOB and BLOB columns.
@changelog_1034_li @changelog_1034_li
#Fulltext search: Data is no longer deleted and re-inserted if the indexed columns didn't change. #Fulltext search: data is no longer deleted and re-inserted if the indexed columns didn't change.
@changelog_1035_li @changelog_1035_li
#In some situations, an ArrayIndexOutOfBoundsException was thrown when adding rows. This was caused by a bug in the b-tree code. #In some situations, an ArrayIndexOutOfBoundsException was thrown when adding rows. This was caused by a bug in the b-tree code.
...@@ -1315,7 +1315,7 @@ Centralリポジトリの利用 ...@@ -1315,7 +1315,7 @@ Centralリポジトリの利用
#MS SQL Server compatibility: support for linked tables with NVARCHAR, NCHAR, NCLOB, and LONGNVARCHAR. #MS SQL Server compatibility: support for linked tables with NVARCHAR, NCHAR, NCLOB, and LONGNVARCHAR.
@changelog_1045_li @changelog_1045_li
#Android: Workaround for a problem when using read-only databases in zip files (skip seems to be implemented incorrectly on the Android system). #Android: workaround for a problem when using read-only databases in zip files (skip seems to be implemented incorrectly on the Android system).
@changelog_1046_li @changelog_1046_li
#Calling execute() or prepareStatement() with null as the SQL statement now throws an exception. #Calling execute() or prepareStatement() with null as the SQL statement now throws an exception.
...@@ -1336,7 +1336,7 @@ Centralリポジトリの利用 ...@@ -1336,7 +1336,7 @@ Centralリポジトリの利用
#JdbcPreparedStatement.toString() could throw a NullPointerException. #JdbcPreparedStatement.toString() could throw a NullPointerException.
@changelog_1052_li @changelog_1052_li
#EclipseLink: Added H2Platform.supportsIdentity(). #EclipseLink: added H2Platform.supportsIdentity().
@changelog_1053_li @changelog_1053_li
#Connection pool: the default login timeout is now 5 minutes. #Connection pool: the default login timeout is now 5 minutes.
...@@ -1552,7 +1552,7 @@ Centralリポジトリの利用 ...@@ -1552,7 +1552,7 @@ Centralリポジトリの利用
#Connection.isValid is a bit faster. #Connection.isValid is a bit faster.
@changelog_1124_li @changelog_1124_li
#H2 Console: The autocomplete feature has been improved a bit. It can now better parse conditions. #H2 Console: the autocomplete feature has been improved a bit. It can now better parse conditions.
@changelog_1125_li @changelog_1125_li
#When restarting a web application in Tomcat, an exception was thrown sometimes. In most cases this was a NullPointerException. A workaround in H2 has been implemented. The root cause of the problem is now documented in the FAQ: Tomcat sets all static fields (final or non-final) to null when unloading a web application. A workaround is to put the h2.jar in the lib directory, or set the system property org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES to false. #When restarting a web application in Tomcat, an exception was thrown sometimes. In most cases this was a NullPointerException. A workaround in H2 has been implemented. The root cause of the problem is now documented in the FAQ: Tomcat sets all static fields (final or non-final) to null when unloading a web application. A workaround is to put the h2.jar in the lib directory, or set the system property org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES to false.
...@@ -1582,13 +1582,13 @@ Centralリポジトリの利用 ...@@ -1582,13 +1582,13 @@ Centralリポジトリの利用
#Statement.setQueryTimeout did not work correctly for some statements. #Statement.setQueryTimeout did not work correctly for some statements.
@changelog_1134_li @changelog_1134_li
#CREATE DOMAIN: Built-in data types can now only be changed if no tables exist. #CREATE DOMAIN: built-in data types can now only be changed if no tables exist.
@changelog_1135_li @changelog_1135_li
#Linked tables: a workaround for Oracle DATE columns has been implemented. #Linked tables: a workaround for Oracle DATE columns has been implemented.
@changelog_1136_li @changelog_1136_li
#DatabaseMetaData.getPrimaryKeys: The column PK_NAME now contains the constraint name instead of the index name (compatibility for PostgreSQL and Derby). #DatabaseMetaData.getPrimaryKeys: the column PK_NAME now contains the constraint name instead of the index name (compatibility for PostgreSQL and Derby).
@changelog_1137_li @changelog_1137_li
#Using IN(..) inside a IN(SELECT..) did not always work. #Using IN(..) inside a IN(SELECT..) did not always work.
...@@ -1606,7 +1606,7 @@ Centralリポジトリの利用 ...@@ -1606,7 +1606,7 @@ Centralリポジトリの利用
#Constraints for local temporary tables now session scoped. So far they were global. Thanks a lot to Eric Faulhaber for finding and fixing this problem! #Constraints for local temporary tables now session scoped. So far they were global. Thanks a lot to Eric Faulhaber for finding and fixing this problem!
@changelog_1142_li @changelog_1142_li
#When using the auto-server mode, and if the lock file was modified in the future, the wrong exception was thrown ('Connection is broken' instead of 'Error opening database: Lock file modified in the future'). #When using the auto-server mode, and if the lock file was modified in the future, the wrong exception was thrown ('Connection is broken' instead of 'Error opening database: lock file modified in the future').
@changelog_1143_h2 @changelog_1143_h2
#Version 1.1.105 (2008-12-19) #Version 1.1.105 (2008-12-19)
...@@ -1654,7 +1654,7 @@ Centralリポジトリの利用 ...@@ -1654,7 +1654,7 @@ Centralリポジトリの利用
#Shell: line comments didn't work correctly. #Shell: line comments didn't work correctly.
@changelog_1158_li @changelog_1158_li
#H2 Console: Columns are now listed for up to 500 tables instead of 100. #H2 Console: columns are now listed for up to 500 tables instead of 100.
@changelog_1159_li @changelog_1159_li
#H2 Console: Cmd+Enter executes the current statement, Alt+Space for autocomplete. #H2 Console: Cmd+Enter executes the current statement, Alt+Space for autocomplete.
...@@ -1759,7 +1759,7 @@ Centralリポジトリの利用 ...@@ -1759,7 +1759,7 @@ Centralリポジトリの利用
#Improved PostgreSQL compatibility for NEXTVAL and CURRVAL. #Improved PostgreSQL compatibility for NEXTVAL and CURRVAL.
@changelog_1193_li @changelog_1193_li
#Less heap memory is needed when multiple databases are open at the same time: The memory reserve (used to rollback after out of memory) is now global and no longer allocated for each database separately. #Less heap memory is needed when multiple databases are open at the same time: the memory reserve (used to rollback after out of memory) is now global and no longer allocated for each database separately.
@changelog_1194_li @changelog_1194_li
#New system property h2.browser to set the browser to use. #New system property h2.browser to set the browser to use.
...@@ -2095,7 +2095,7 @@ Centralリポジトリの利用 ...@@ -2095,7 +2095,7 @@ Centralリポジトリの利用
#ORDER BY on tableName.columnName didn't work correctly if the column name was also used as an alias. #ORDER BY on tableName.columnName didn't work correctly if the column name was also used as an alias.
@changelog_1305_li @changelog_1305_li
#H2 Console: The progress display when opening a database has been improved. #H2 Console: the progress display when opening a database has been improved.
@changelog_1306_li @changelog_1306_li
#The error message when the server doesn't start has been improved. #The error message when the server doesn't start has been improved.
...@@ -3655,7 +3655,7 @@ SQLコマンド SET LOCK_TIMEOUT &lt;milliseconds&gt; を使用して、ロッ ...@@ -3655,7 +3655,7 @@ SQLコマンド SET LOCK_TIMEOUT &lt;milliseconds&gt; を使用して、ロッ
データベースファイルレイアウト データベースファイルレイアウト
@features_1423_p @features_1423_p
#There are a number of files created for persistent databases. Unlike some other databases, not every table and/or index is stored in its own file. Instead, usually only the following files are created: A data file, an index file, a log file, and a database lock file (exists only while the database is in use). In addition to that, a file is created for each large object (CLOB/BLOB) larger than a certain size, and temporary files for large result sets. If the database trace option is enabled, trace files are created. The following files can be created by the database: #There are a number of files created for persistent databases. Unlike some other databases, not every table and/or index is stored in its own file. Instead, usually only the following files are created: a data file, an index file, a log file, and a database lock file (exists only while the database is in use). In addition to that, a file is created for each large object (CLOB/BLOB) larger than a certain size, and temporary files for large result sets. If the database trace option is enabled, trace files are created. The following files can be created by the database:
@features_1424_th @features_1424_th
ファイル名 ファイル名
...@@ -3952,7 +3952,7 @@ checksumのレコードが合わないために (例えば、別のアプリケ ...@@ -3952,7 +3952,7 @@ checksumのレコードが合わないために (例えば、別のアプリケ
#The application that opens the first connection to the database uses the embedded mode, which is faster than the server mode. Therefore the main application should open the database first if possible. The first connection automatically starts a server on a random port. This server allows remote connections, however only to this database (to ensure that, the client reads .lock.db file and sends the the random key that is stored there to the server). When the first connection is closed, the server stops. If other (remote) connections are still open, one of them will then start a server (auto-reconnect is enabled automatically). #The application that opens the first connection to the database uses the embedded mode, which is faster than the server mode. Therefore the main application should open the database first if possible. The first connection automatically starts a server on a random port. This server allows remote connections, however only to this database (to ensure that, the client reads .lock.db file and sends the the random key that is stored there to the server). When the first connection is closed, the server stops. If other (remote) connections are still open, one of them will then start a server (auto-reconnect is enabled automatically).
@features_1522_p @features_1522_p
#This mode has three disadvantages: All processes need to have access to the database files. Then, if the first connection is closed (the connection that started the server), open transactions of other connections will be rolled back. Also, explicit client/server connections (using jdbc:h2:tcp:// or ssl://) are not supported. #This mode has three disadvantages: all processes need to have access to the database files. Then, if the first connection is closed (the connection that started the server), open transactions of other connections will be rolled back. Also, explicit client/server connections (using jdbc:h2:tcp:// or ssl://) are not supported.
@features_1523_p @features_1523_p
#Here is an example how to use this mode. Application 1 and 2 are not necessarily started on the same computer, but they need to have access to the database files. Application 1 and 2 are typically two different processes (however they could run within the same process). #Here is an example how to use this mode. Application 1 and 2 are not necessarily started on the same computer, but they need to have access to the database files. Application 1 and 2 are typically two different processes (however they could run within the same process).
...@@ -4027,7 +4027,7 @@ Javaコード生成 ...@@ -4027,7 +4027,7 @@ Javaコード生成
読み取り専用データベース 読み取り専用データベース
@features_1547_p @features_1547_p
#If the database files are read-only, then the database is read-only as well. It is not possible to create new tables, add or modify data in this database. Only SELECT and CALL statements are allowed. To create a read-only database, close the database so that the log file gets smaller. Do not delete the log file. Then, make the database files read-only using the operating system. When you open the database now, it is read-only. There are two ways an application can find out whether database is read-only: By calling Connection.isReadOnly() or by executing the SQL statement CALL READONLY(). #If the database files are read-only, then the database is read-only as well. It is not possible to create new tables, add or modify data in this database. Only SELECT and CALL statements are allowed. To create a read-only database, close the database so that the log file gets smaller. Do not delete the log file. Then, make the database files read-only using the operating system. When you open the database now, it is read-only. There are two ways an application can find out whether database is read-only: by calling Connection.isReadOnly() or by executing the SQL statement CALL READONLY().
@features_1548_h2 @features_1548_h2
#Read Only Databases in Zip or Jar File #Read Only Databases in Zip or Jar File
...@@ -4156,7 +4156,7 @@ SimpleResultSetを使用する ...@@ -4156,7 +4156,7 @@ SimpleResultSetを使用する
関数をテーブルとして使用する 関数をテーブルとして使用する
@features_1590_p @features_1590_p
#A function that returns a result set can be used like a table. However, in this case the function is called at least twice: First while parsing the statement to collect the column names (with parameters set to null where not known at compile time). And then, while executing the statement to get the data (maybe multiple times if this is a join). If the function is called just to get the column list, the URL of the connection passed to the function is <code>jdbc:columnlist:connection</code> . Otherwise, the URL of the connection is <code>jdbc:default:connection</code> . #A function that returns a result set can be used like a table. However, in this case the function is called at least twice: first while parsing the statement to collect the column names (with parameters set to null where not known at compile time). And then, while executing the statement to get the data (maybe multiple times if this is a join). If the function is called just to get the column list, the URL of the connection passed to the function is <code>jdbc:columnlist:connection</code> . Otherwise, the URL of the connection is <code>jdbc:default:connection</code> .
@features_1591_h2 @features_1591_h2
トリガー トリガー
...@@ -4366,7 +4366,7 @@ Unicodeをサポート ...@@ -4366,7 +4366,7 @@ Unicodeをサポート
#A lot of features are already built in (for example Unicode, network libraries). It is very easy to write secure code because buffer overflows can not occur. Some features such as the reflection mechanism can be used for randomized testing. #A lot of features are already built in (for example Unicode, network libraries). It is very easy to write secure code because buffer overflows can not occur. Some features such as the reflection mechanism can be used for randomized testing.
@history_1021_p @history_1021_p
Javaは将来への証明でもあります: 多くの会社がJavaをサポートし、今ではオープンソースです。 #Java is also future proof: a lot of companies support Java, and it is now open source.
@history_1022_p @history_1022_p
このソフトウェアは、移植性の増加と使いやすさのため、そしてパフォーマンスの理由から、多くのJavaライブラリ、または他のソフトウェアを信頼していません。例えば、暗号化アルゴリズムと多数のライブラリ関数は、存在するライブラリを使用する代わりにデータベースに実装されています。SwingのようなオープンソースのJava実装が有効でないライブラリは使用されていないか、特定の特徴のみに使用されます。 このソフトウェアは、移植性の増加と使いやすさのため、そしてパフォーマンスの理由から、多くのJavaライブラリ、または他のソフトウェアを信頼していません。例えば、暗号化アルゴリズムと多数のライブラリ関数は、存在するライブラリを使用する代わりにデータベースに実装されています。SwingのようなオープンソースのJava実装が有効でないライブラリは使用されていないか、特定の特徴のみに使用されます。
...@@ -4564,7 +4564,7 @@ Sourceファイル ...@@ -4564,7 +4564,7 @@ Sourceファイル
#Why in Java? #Why in Java?
@jaqu_1011_p @jaqu_1011_p
#Most people use Java in their application. Mixing Java and another language (for example Scala or Groovy) in the same application is complicated: You would need to split the application and database code. #Most people use Java in their application. Mixing Java and another language (for example Scala or Groovy) in the same application is complicated: you would need to split the application and database code.
@jaqu_1012_h2 @jaqu_1012_h2
#Current State #Current State
...@@ -4678,10 +4678,10 @@ Sourceファイル ...@@ -4678,10 +4678,10 @@ Sourceファイル
#You don't need to provide the source code of H2 if you did not modify anything. #You don't need to provide the source code of H2 if you did not modify anything.
@license_1008_p @license_1008_p
#However, nobody is allowed to rename H2, modify it a little, and sell it as a database engine without telling the customers it is in fact H2. This happened to HSQLDB: A company called 'bungisoft' copied HSQLDB, renamed it to 'RedBase', and tried to sell it, hiding the fact that it was in fact just HSQLDB. It seems 'bungisoft' does not exist any more, but you can use the Wayback Machine of http://www.archive.org and visit old web pages of http://www.bungisoft.com . #However, nobody is allowed to rename H2, modify it a little, and sell it as a database engine without telling the customers it is in fact H2. This happened to HSQLDB: a company called 'bungisoft' copied HSQLDB, renamed it to 'RedBase', and tried to sell it, hiding the fact that it was in fact just HSQLDB. It seems 'bungisoft' does not exist any more, but you can use the Wayback Machine of http://www.archive.org and visit old web pages of http://www.bungisoft.com .
@license_1009_p @license_1009_p
#About porting the source code to another language (for example C# or C++): Converted source code (even if done manually) stays under the same copyright and license as the original code. The copyright of the ported source code does not (automatically) go to the person who ported the code. #About porting the source code to another language (for example C# or C++): converted source code (even if done manually) stays under the same copyright and license as the original code. The copyright of the ported source code does not (automatically) go to the person who ported the code.
@license_1010_h2 @license_1010_h2
#H2 License, Version 1.0 #H2 License, Version 1.0
...@@ -6105,263 +6105,263 @@ See what this database can do and how to use these features. ...@@ -6105,263 +6105,263 @@ See what this database can do and how to use these features.
@performance_1005_a @performance_1005_a
#Performance Tuning #Performance Tuning
@performance_1006_h2 @performance_1006_a
#Fast Database Import
@performance_1007_h2
#Performance Comparison #Performance Comparison
@performance_1007_p @performance_1008_p
#In many cases H2 is faster than other (open source and not open source) database engines. Please note this is mostly a single connection benchmark run on one computer. #In many cases H2 is faster than other (open source and not open source) database engines. Please note this is mostly a single connection benchmark run on one computer.
@performance_1008_h3 @performance_1009_h3
#Embedded #Embedded
@performance_1009_th @performance_1010_th
#Test Case #Test Case
@performance_1010_th @performance_1011_th
#Unit #Unit
@performance_1011_th @performance_1012_th
H2 H2
@performance_1012_th @performance_1013_th
HSQLDB HSQLDB
@performance_1013_th @performance_1014_th
Derby Derby
@performance_1014_td
#Simple: Init
@performance_1015_td @performance_1015_td
#ms #Simple: Init
@performance_1016_td @performance_1016_td
#547 #ms
@performance_1017_td @performance_1017_td
#532 #547
@performance_1018_td @performance_1018_td
#2594 #532
@performance_1019_td @performance_1019_td
#Simple: Query (random) #2594
@performance_1020_td @performance_1020_td
#ms #Simple: Query (random)
@performance_1021_td @performance_1021_td
#250 #ms
@performance_1022_td @performance_1022_td
#391 #250
@performance_1023_td @performance_1023_td
#1515 #391
@performance_1024_td @performance_1024_td
#Simple: Query (sequential) #1515
@performance_1025_td @performance_1025_td
#ms #Simple: Query (sequential)
@performance_1026_td @performance_1026_td
#188 #ms
@performance_1027_td @performance_1027_td
#313 #188
@performance_1028_td @performance_1028_td
#1406 #313
@performance_1029_td @performance_1029_td
#Simple: Update (random) #1406
@performance_1030_td @performance_1030_td
#ms #Simple: Update (random)
@performance_1031_td @performance_1031_td
#812 #ms
@performance_1032_td @performance_1032_td
#1750 #812
@performance_1033_td @performance_1033_td
#17704 #1750
@performance_1034_td @performance_1034_td
#Simple: Delete (sequential) #17704
@performance_1035_td @performance_1035_td
#ms #Simple: Delete (sequential)
@performance_1036_td @performance_1036_td
#203 #ms
@performance_1037_td @performance_1037_td
#250 #203
@performance_1038_td @performance_1038_td
#8843 #250
@performance_1039_td @performance_1039_td
#Simple: Memory Usage #8843
@performance_1040_td @performance_1040_td
#MB #Simple: Memory Usage
@performance_1041_td @performance_1041_td
#7 #MB
@performance_1042_td @performance_1042_td
#11 #7
@performance_1043_td @performance_1043_td
#11 #11
@performance_1044_td @performance_1044_td
#BenchA: Init #11
@performance_1045_td @performance_1045_td
#ms #BenchA: Init
@performance_1046_td @performance_1046_td
#578 #ms
@performance_1047_td @performance_1047_td
#719 #578
@performance_1048_td @performance_1048_td
#3328 #719
@performance_1049_td @performance_1049_td
#BenchA: Transactions #3328
@performance_1050_td @performance_1050_td
#ms #BenchA: Transactions
@performance_1051_td @performance_1051_td
#3047 #ms
@performance_1052_td @performance_1052_td
#2406 #3047
@performance_1053_td @performance_1053_td
#12907 #2406
@performance_1054_td @performance_1054_td
#BenchA: Memory Usage #12907
@performance_1055_td @performance_1055_td
#MB #BenchA: Memory Usage
@performance_1056_td @performance_1056_td
#10 #MB
@performance_1057_td @performance_1057_td
#15 #10
@performance_1058_td @performance_1058_td
#10 #15
@performance_1059_td @performance_1059_td
#BenchB: Init #10
@performance_1060_td @performance_1060_td
#ms #BenchB: Init
@performance_1061_td @performance_1061_td
#2141 #ms
@performance_1062_td @performance_1062_td
#2406 #2141
@performance_1063_td @performance_1063_td
#11562 #2406
@performance_1064_td @performance_1064_td
#BenchB: Transactions #11562
@performance_1065_td @performance_1065_td
#ms #BenchB: Transactions
@performance_1066_td @performance_1066_td
#1125 #ms
@performance_1067_td @performance_1067_td
#1375 #1125
@performance_1068_td @performance_1068_td
#3625 #1375
@performance_1069_td @performance_1069_td
#BenchB: Memory Usage #3625
@performance_1070_td @performance_1070_td
#MB #BenchB: Memory Usage
@performance_1071_td @performance_1071_td
#9 #MB
@performance_1072_td @performance_1072_td
#11 #9
@performance_1073_td @performance_1073_td
#8 #11
@performance_1074_td @performance_1074_td
#BenchC: Init #8
@performance_1075_td @performance_1075_td
#ms #BenchC: Init
@performance_1076_td @performance_1076_td
#688 #ms
@performance_1077_td @performance_1077_td
#594 #688
@performance_1078_td @performance_1078_td
#4500 #594
@performance_1079_td @performance_1079_td
#BenchC: Transactions #4500
@performance_1080_td @performance_1080_td
#ms #BenchC: Transactions
@performance_1081_td @performance_1081_td
#1906 #ms
@performance_1082_td @performance_1082_td
#64062 #1906
@performance_1083_td @performance_1083_td
#6047 #64062
@performance_1084_td @performance_1084_td
#BenchC: Memory Usage #6047
@performance_1085_td @performance_1085_td
#MB #BenchC: Memory Usage
@performance_1086_td @performance_1086_td
#11 #MB
@performance_1087_td @performance_1087_td
#17 #11
@performance_1088_td @performance_1088_td
#11 #17
@performance_1089_td @performance_1089_td
#Executed statements #11
@performance_1090_td @performance_1090_td
## #Executed statements
@performance_1091_td @performance_1091_td
#322929 ##
@performance_1092_td @performance_1092_td
#322929 #322929
...@@ -6370,382 +6370,382 @@ Derby ...@@ -6370,382 +6370,382 @@ Derby
#322929 #322929
@performance_1094_td @performance_1094_td
#Total time #322929
@performance_1095_td @performance_1095_td
#ms #Total time
@performance_1096_td @performance_1096_td
#11485 #ms
@performance_1097_td @performance_1097_td
#74798 #11485
@performance_1098_td @performance_1098_td
#74031 #74798
@performance_1099_td @performance_1099_td
#Statements per second #74031
@performance_1100_td @performance_1100_td
## #Statements per second
@performance_1101_td @performance_1101_td
#28117 ##
@performance_1102_td @performance_1102_td
#4317 #28117
@performance_1103_td @performance_1103_td
#4317
@performance_1104_td
#4362 #4362
@performance_1104_h3 @performance_1105_h3
#Client-Server #Client-Server
@performance_1105_th @performance_1106_th
#Test Case #Test Case
@performance_1106_th @performance_1107_th
#Unit #Unit
@performance_1107_th @performance_1108_th
H2 H2
@performance_1108_th @performance_1109_th
HSQLDB HSQLDB
@performance_1109_th @performance_1110_th
Derby Derby
@performance_1110_th @performance_1111_th
PostgreSQL PostgreSQL
@performance_1111_th @performance_1112_th
MySQL MySQL
@performance_1112_td
#Simple: Init
@performance_1113_td @performance_1113_td
#ms #Simple: Init
@performance_1114_td @performance_1114_td
#2782 #ms
@performance_1115_td @performance_1115_td
#2656 #2782
@performance_1116_td @performance_1116_td
#5625 #2656
@performance_1117_td @performance_1117_td
#4563 #5625
@performance_1118_td @performance_1118_td
#3484 #4563
@performance_1119_td @performance_1119_td
#Simple: Query (random) #3484
@performance_1120_td @performance_1120_td
#ms #Simple: Query (random)
@performance_1121_td @performance_1121_td
#3093 #ms
@performance_1122_td @performance_1122_td
#2703 #3093
@performance_1123_td @performance_1123_td
#6688 #2703
@performance_1124_td @performance_1124_td
#4812 #6688
@performance_1125_td @performance_1125_td
#3860 #4812
@performance_1126_td @performance_1126_td
#Simple: Query (sequential) #3860
@performance_1127_td @performance_1127_td
#ms #Simple: Query (sequential)
@performance_1128_td @performance_1128_td
#2969 #ms
@performance_1129_td @performance_1129_td
#2594 #2969
@performance_1130_td @performance_1130_td
#6437 #2594
@performance_1131_td @performance_1131_td
#4719 #6437
@performance_1132_td @performance_1132_td
#3625 #4719
@performance_1133_td @performance_1133_td
#Simple: Update (random) #3625
@performance_1134_td @performance_1134_td
#ms #Simple: Update (random)
@performance_1135_td @performance_1135_td
#2969 #ms
@performance_1136_td @performance_1136_td
#3531 #2969
@performance_1137_td @performance_1137_td
#18250 #3531
@performance_1138_td @performance_1138_td
#5953 #18250
@performance_1139_td @performance_1139_td
#5125 #5953
@performance_1140_td @performance_1140_td
#Simple: Delete (sequential) #5125
@performance_1141_td @performance_1141_td
#ms #Simple: Delete (sequential)
@performance_1142_td @performance_1142_td
#1047 #ms
@performance_1143_td @performance_1143_td
#1250 #1047
@performance_1144_td @performance_1144_td
#6875 #1250
@performance_1145_td @performance_1145_td
#2485 #6875
@performance_1146_td @performance_1146_td
#2390 #2485
@performance_1147_td @performance_1147_td
#Simple: Memory Usage #2390
@performance_1148_td @performance_1148_td
#MB #Simple: Memory Usage
@performance_1149_td @performance_1149_td
#7 #MB
@performance_1150_td @performance_1150_td
#11 #7
@performance_1151_td @performance_1151_td
#14 #11
@performance_1152_td @performance_1152_td
#0 #14
@performance_1153_td @performance_1153_td
#0 #0
@performance_1154_td @performance_1154_td
#BenchA: Init #0
@performance_1155_td @performance_1155_td
#ms #BenchA: Init
@performance_1156_td @performance_1156_td
#2250 #ms
@performance_1157_td @performance_1157_td
#2453 #2250
@performance_1158_td @performance_1158_td
#6031 #2453
@performance_1159_td @performance_1159_td
#4328 #6031
@performance_1160_td @performance_1160_td
#3625 #4328
@performance_1161_td @performance_1161_td
#BenchA: Transactions #3625
@performance_1162_td @performance_1162_td
#ms #BenchA: Transactions
@performance_1163_td @performance_1163_td
#10250 #ms
@performance_1164_td @performance_1164_td
#9016 #10250
@performance_1165_td @performance_1165_td
#21484 #9016
@performance_1166_td @performance_1166_td
#15609 #21484
@performance_1167_td @performance_1167_td
#11172 #15609
@performance_1168_td @performance_1168_td
#BenchA: Memory Usage #11172
@performance_1169_td @performance_1169_td
#MB #BenchA: Memory Usage
@performance_1170_td @performance_1170_td
#10 #MB
@performance_1171_td @performance_1171_td
#15 #10
@performance_1172_td @performance_1172_td
#10 #15
@performance_1173_td @performance_1173_td
#0 #10
@performance_1174_td @performance_1174_td
#1 #0
@performance_1175_td @performance_1175_td
#BenchB: Init #1
@performance_1176_td @performance_1176_td
#ms #BenchB: Init
@performance_1177_td @performance_1177_td
#9500 #ms
@performance_1178_td @performance_1178_td
#10672 #9500
@performance_1179_td @performance_1179_td
#22609 #10672
@performance_1180_td @performance_1180_td
#19609 #22609
@performance_1181_td @performance_1181_td
#13406 #19609
@performance_1182_td @performance_1182_td
#BenchB: Transactions #13406
@performance_1183_td @performance_1183_td
#ms #BenchB: Transactions
@performance_1184_td @performance_1184_td
#2734 #ms
@performance_1185_td @performance_1185_td
#2656 #2734
@performance_1186_td @performance_1186_td
#3875 #2656
@performance_1187_td @performance_1187_td
#4688 #3875
@performance_1188_td @performance_1188_td
#2531 #4688
@performance_1189_td @performance_1189_td
#BenchB: Memory Usage #2531
@performance_1190_td @performance_1190_td
#MB #BenchB: Memory Usage
@performance_1191_td @performance_1191_td
#10 #MB
@performance_1192_td @performance_1192_td
#11 #10
@performance_1193_td @performance_1193_td
#11 #11
@performance_1194_td @performance_1194_td
#1 #11
@performance_1195_td @performance_1195_td
#1 #1
@performance_1196_td @performance_1196_td
#BenchC: Init #1
@performance_1197_td @performance_1197_td
#ms #BenchC: Init
@performance_1198_td @performance_1198_td
#1860 #ms
@performance_1199_td @performance_1199_td
#1484 #1860
@performance_1200_td @performance_1200_td
#6890 #1484
@performance_1201_td @performance_1201_td
#2219 #6890
@performance_1202_td @performance_1202_td
#3438 #2219
@performance_1203_td @performance_1203_td
#BenchC: Transactions #3438
@performance_1204_td @performance_1204_td
#ms #BenchC: Transactions
@performance_1205_td @performance_1205_td
#9046 #ms
@performance_1206_td @performance_1206_td
#63266 #9046
@performance_1207_td @performance_1207_td
#18641 #63266
@performance_1208_td @performance_1208_td
#11703 #18641
@performance_1209_td @performance_1209_td
#7421 #11703
@performance_1210_td @performance_1210_td
#BenchC: Memory Usage #7421
@performance_1211_td @performance_1211_td
#MB #BenchC: Memory Usage
@performance_1212_td @performance_1212_td
#12 #MB
@performance_1213_td @performance_1213_td
#17 #12
@performance_1214_td @performance_1214_td
#13 #17
@performance_1215_td @performance_1215_td
#0 #13
@performance_1216_td @performance_1216_td
#1 #0
@performance_1217_td @performance_1217_td
#Executed statements #1
@performance_1218_td @performance_1218_td
## #Executed statements
@performance_1219_td @performance_1219_td
#322929 ##
@performance_1220_td @performance_1220_td
#322929 #322929
...@@ -6760,595 +6760,619 @@ MySQL ...@@ -6760,595 +6760,619 @@ MySQL
#322929 #322929
@performance_1224_td @performance_1224_td
#Total time #322929
@performance_1225_td @performance_1225_td
#ms #Total time
@performance_1226_td @performance_1226_td
#48500 #ms
@performance_1227_td @performance_1227_td
#102281 #48500
@performance_1228_td @performance_1228_td
#123405 #102281
@performance_1229_td @performance_1229_td
#80688 #123405
@performance_1230_td @performance_1230_td
#60077 #80688
@performance_1231_td @performance_1231_td
#Statements per second #60077
@performance_1232_td @performance_1232_td
## #Statements per second
@performance_1233_td @performance_1233_td
#6658 ##
@performance_1234_td @performance_1234_td
#3157 #6658
@performance_1235_td @performance_1235_td
#2616 #3157
@performance_1236_td @performance_1236_td
#4002 #2616
@performance_1237_td @performance_1237_td
#4002
@performance_1238_td
#5375 #5375
@performance_1238_h3 @performance_1239_h3
#Benchmark Results and Comments #Benchmark Results and Comments
@performance_1239_h4 @performance_1240_h4
H2 H2
@performance_1240_p @performance_1241_p
#Version 1.1.114 (2009-06-01) was used for the test. For simpler operations, the performance of H2 is about the same as for HSQLDB. For more complex queries, the query optimizer is very important. However H2 is not very fast in every case, certain kind of queries may still be slow. One situation where is H2 is slow is large result sets, because they are buffered to disk if more than a certain number of records are returned. The advantage of buffering is, there is no limit on the result set size. The open/close time is almost fixed, because of the file locking protocol: The engine waits some time after opening a database to ensure the database files are not opened by another process. #Version 1.1.114 (2009-06-01) was used for the test. For simpler operations, the performance of H2 is about the same as for HSQLDB. For more complex queries, the query optimizer is very important. However H2 is not very fast in every case, certain kind of queries may still be slow. One situation where is H2 is slow is large result sets, because they are buffered to disk if more than a certain number of records are returned. The advantage of buffering is, there is no limit on the result set size. The open/close time is almost fixed, because of the file locking protocol: the engine waits some time after opening a database to ensure the database files are not opened by another process.
@performance_1241_h4 @performance_1242_h4
HSQLDB HSQLDB
@performance_1242_p @performance_1243_p
#Version 1.8.0.10 was used for the test. Cached tables are used in this test (hsqldb.default_table_type=cached), and the write delay is 1 second (SET WRITE_DELAY 1). HSQLDB is fast when using simple operations. HSQLDB is very slow in the last test (BenchC: Transactions), probably because is has a bad query optimizer. One query where HSQLDB is slow is a two-table join: #Version 1.8.0.10 was used for the test. Cached tables are used in this test (hsqldb.default_table_type=cached), and the write delay is 1 second (SET WRITE_DELAY 1). HSQLDB is fast when using simple operations. HSQLDB is very slow in the last test (BenchC: Transactions), probably because is has a bad query optimizer. One query where HSQLDB is slow is a two-table join:
@performance_1243_p @performance_1244_p
#The PolePosition benchmark also shows that the query optimizer does not do a very good job for some queries. Another disadvantage of HSQLDB is the slow startup / shutdown time (currently not listed) when using bigger databases. The reason is, a backup of the whole data is made whenever the database is opened or closed. #The PolePosition benchmark also shows that the query optimizer does not do a very good job for some queries. Another disadvantage of HSQLDB is the slow startup / shutdown time (currently not listed) when using bigger databases. The reason is, a backup of the whole data is made whenever the database is opened or closed.
@performance_1244_h4 @performance_1245_h4
Derby Derby
@performance_1245_p @performance_1246_p
#Version 10.4.2.0 was used for the test. Derby is clearly the slowest embedded database in this test. This seems to be a structural problem, because all operations are really slow. It will be hard for the developers of Derby to improve the performance to a reasonable level. A few problems have been identified: Leaving autocommit on is a problem for Derby. If it is switched off during the whole test, the results are about 20% better for Derby. Derby supports a testing mode (system property derby.system.durability=test) where durability is disabled. According to the documentation, this setting should be used for testing only, as the database may not recover after a crash. Enabling this setting improves performance by a factor of 2.6 (embedded mode) or 1.4 (server mode). Even if enabled, Derby is still less than half as fast as H2 in default mode. #Version 10.4.2.0 was used for the test. Derby is clearly the slowest embedded database in this test. This seems to be a structural problem, because all operations are really slow. It will be hard for the developers of Derby to improve the performance to a reasonable level. A few problems have been identified: leaving autocommit on is a problem for Derby. If it is switched off during the whole test, the results are about 20% better for Derby. Derby supports a testing mode (system property derby.system.durability=test) where durability is disabled. According to the documentation, this setting should be used for testing only, as the database may not recover after a crash. Enabling this setting improves performance by a factor of 2.6 (embedded mode) or 1.4 (server mode). Even if enabled, Derby is still less than half as fast as H2 in default mode.
@performance_1246_h4 @performance_1247_h4
PostgreSQL PostgreSQL
@performance_1247_p @performance_1248_p
#Version 8.3.7 was used for the test. The following options where changed in postgresql.conf: fsync = off, commit_delay = 1000. PostgreSQL is run in server mode. It looks like the base performance is slower than MySQL, the reason could be the network layer. The memory usage number is incorrect, because only the memory usage of the JDBC driver is measured. #Version 8.3.7 was used for the test. The following options where changed in postgresql.conf: fsync = off, commit_delay = 1000. PostgreSQL is run in server mode. It looks like the base performance is slower than MySQL, the reason could be the network layer. The memory usage number is incorrect, because only the memory usage of the JDBC driver is measured.
@performance_1248_h4 @performance_1249_h4
MySQL MySQL
@performance_1249_p @performance_1250_p
#Version 5.1.34-community was used for the test. MySQL was run with the InnoDB backend. The setting innodb_flush_log_at_trx_commit (found in the my.ini file) was set to 0. Otherwise (and by default), MySQL is really slow (around 140 statements per second in this test) because it tries to flush the data to disk for each commit. For small transactions (when autocommit is on) this is really slow. But many use cases use small or relatively small transactions. Too bad this setting is not listed in the configuration wizard, and it always overwritten when using the wizard. You need to change this setting manually in the file my.ini, and then restart the service. The memory usage number is incorrect, because only the memory usage of the JDBC driver is measured. #Version 5.1.34-community was used for the test. MySQL was run with the InnoDB backend. The setting innodb_flush_log_at_trx_commit (found in the my.ini file) was set to 0. Otherwise (and by default), MySQL is really slow (around 140 statements per second in this test) because it tries to flush the data to disk for each commit. For small transactions (when autocommit is on) this is really slow. But many use cases use small or relatively small transactions. Too bad this setting is not listed in the configuration wizard, and it always overwritten when using the wizard. You need to change this setting manually in the file my.ini, and then restart the service. The memory usage number is incorrect, because only the memory usage of the JDBC driver is measured.
@performance_1250_h4 @performance_1251_h4
#Firebird #Firebird
@performance_1251_p @performance_1252_p
#Firebird 1.5 (default installation) was tested, but the results are not published currently. It is possible to run the performance test with the Firebird database, and any information on how to configure Firebird for higher performance are welcome. #Firebird 1.5 (default installation) was tested, but the results are not published currently. It is possible to run the performance test with the Firebird database, and any information on how to configure Firebird for higher performance are welcome.
@performance_1252_h4 @performance_1253_h4
#Why Oracle / MS SQL Server / DB2 are Not Listed #Why Oracle / MS SQL Server / DB2 are Not Listed
@performance_1253_p @performance_1254_p
#The license of these databases does not allow to publish benchmark results. This doesn't mean that they are fast. They are in fact quite slow, and need a lot of memory. But you will need to test this yourself. SQLite was not tested because the JDBC driver doesn't support transactions. #The license of these databases does not allow to publish benchmark results. This doesn't mean that they are fast. They are in fact quite slow, and need a lot of memory. But you will need to test this yourself. SQLite was not tested because the JDBC driver doesn't support transactions.
@performance_1254_h3 @performance_1255_h3
#About this Benchmark #About this Benchmark
@performance_1255_h4 @performance_1256_h4
#How to Run #How to Run
@performance_1256_p @performance_1257_p
#This test was executed as follows: #This test was executed as follows:
@performance_1257_h4 @performance_1258_h4
#Separate Process per Database #Separate Process per Database
@performance_1258_p @performance_1259_p
#For each database, a new process is started, to ensure the previous test does not impact the current test. #For each database, a new process is started, to ensure the previous test does not impact the current test.
@performance_1259_h4 @performance_1260_h4
#Number of Connections #Number of Connections
@performance_1260_p @performance_1261_p
#This is mostly a single-connection benchmark. BenchB uses multiple connections; the other tests use one connection. #This is mostly a single-connection benchmark. BenchB uses multiple connections; the other tests use one connection.
@performance_1261_h4 @performance_1262_h4
#Real-World Tests #Real-World Tests
@performance_1262_p @performance_1263_p
#Good benchmarks emulate real-world use cases. This benchmark includes 3 test cases: A simple test case with one table and many small updates / deletes. BenchA is similar to the TPC-A test, but single connection / single threaded (see also: www.tpc.org). BenchB is similar to the TPC-B test, using multiple connections (one thread per connection). BenchC is similar to the TPC-C test, but single connection / single threaded. #Good benchmarks emulate real-world use cases. This benchmark includes 4 test cases: BenchSimple uses one table and many small updates / deletes. BenchA is similar to the TPC-A test, but single connection / single threaded (see also: www.tpc.org). BenchB is similar to the TPC-B test, using multiple connections (one thread per connection). BenchC is similar to the TPC-C test, but single connection / single threaded.
@performance_1263_h4 @performance_1264_h4
#Comparing Embedded with Server Databases #Comparing Embedded with Server Databases
@performance_1264_p @performance_1265_p
#This is mainly a benchmark for embedded databases (where the application runs in the same virtual machine as the database engine). However MySQL and PostgreSQL are not Java databases and cannot be embedded into a Java application. For the Java databases, both embedded and server modes are tested. #This is mainly a benchmark for embedded databases (where the application runs in the same virtual machine as the database engine). However MySQL and PostgreSQL are not Java databases and cannot be embedded into a Java application. For the Java databases, both embedded and server modes are tested.
@performance_1265_h4 @performance_1266_h4
#Test Platform #Test Platform
@performance_1266_p @performance_1267_p
#This test is run on Windows XP with the virus scanner switched off. The VM used is Sun JDK 1.5. #This test is run on Windows XP with the virus scanner switched off. The VM used is Sun JDK 1.5.
@performance_1267_h4 @performance_1268_h4
#Multiple Runs #Multiple Runs
@performance_1268_p @performance_1269_p
#When a Java benchmark is run first, the code is not fully compiled and therefore runs slower than when running multiple times. A benchmark should always run the same test multiple times and ignore the first run(s). This benchmark runs three times, but only the last run is measured. #When a Java benchmark is run first, the code is not fully compiled and therefore runs slower than when running multiple times. A benchmark should always run the same test multiple times and ignore the first run(s). This benchmark runs three times, but only the last run is measured.
@performance_1269_h4 @performance_1270_h4
#Memory Usage #Memory Usage
@performance_1270_p @performance_1271_p
#It is not enough to measure the time taken, the memory usage is important as well. Performance can be improved by using a bigger cache, but the amount of memory is limited. HSQLDB tables are kept fully in memory by default; this benchmark uses 'disk based' tables for all databases. Unfortunately, it is not so easy to calculate the memory usage of PostgreSQL and MySQL, because they run in a different process than the test. This benchmark currently does not print memory usage of those databases. #It is not enough to measure the time taken, the memory usage is important as well. Performance can be improved by using a bigger cache, but the amount of memory is limited. HSQLDB tables are kept fully in memory by default; this benchmark uses 'disk based' tables for all databases. Unfortunately, it is not so easy to calculate the memory usage of PostgreSQL and MySQL, because they run in a different process than the test. This benchmark currently does not print memory usage of those databases.
@performance_1271_h4 @performance_1272_h4
#Delayed Operations #Delayed Operations
@performance_1272_p @performance_1273_p
#Some databases delay some operations (for example flushing the buffers) until after the benchmark is run. This benchmark waits between each database tested, and each database runs in a different process (sequentially). #Some databases delay some operations (for example flushing the buffers) until after the benchmark is run. This benchmark waits between each database tested, and each database runs in a different process (sequentially).
@performance_1273_h4 @performance_1274_h4
#Transaction Commit / Durability #Transaction Commit / Durability
@performance_1274_p @performance_1275_p
#Durability means transaction committed to the database will not be lost. Some databases (for example MySQL) try to enforce this by default by calling fsync() to flush the buffers, but most hard drives don't actually flush all data. Calling fsync() slows down transaction commit a lot, but doesn't always make data durable. When comparing the results, it is important to think about the effect. Many database suggest to 'batch' operations when possible. This benchmark switches off autocommit when loading the data, and calls commit after each 1000 inserts. However many applications need 'short' transactions at runtime (a commit after each update). This benchmark commits after each update / delete in the simple benchmark, and after each business transaction in the other benchmarks. For databases that support delayed commits, a delay of one second is used. #Durability means transaction committed to the database will not be lost. Some databases (for example MySQL) try to enforce this by default by calling fsync() to flush the buffers, but most hard drives don't actually flush all data. Calling fsync() slows down transaction commit a lot, but doesn't always make data durable. When comparing the results, it is important to think about the effect. Many database suggest to 'batch' operations when possible. This benchmark switches off autocommit when loading the data, and calls commit after each 1000 inserts. However many applications need 'short' transactions at runtime (a commit after each update). This benchmark commits after each update / delete in the simple benchmark, and after each business transaction in the other benchmarks. For databases that support delayed commits, a delay of one second is used.
@performance_1275_h4 @performance_1276_h4
#Using Prepared Statements #Using Prepared Statements
@performance_1276_p @performance_1277_p
#Wherever possible, the test cases use prepared statements. #Wherever possible, the test cases use prepared statements.
@performance_1277_h4 @performance_1278_h4
#Currently Not Tested: Startup Time #Currently Not Tested: Startup Time
@performance_1278_p @performance_1279_p
#The startup time of a database engine is important as well for embedded use. This time is not measured currently. Also, not tested is the time used to create a database and open an existing database. Here, one (wrapper) connection is opened at the start, and for each step a new connection is opened and then closed. #The startup time of a database engine is important as well for embedded use. This time is not measured currently. Also, not tested is the time used to create a database and open an existing database. Here, one (wrapper) connection is opened at the start, and for each step a new connection is opened and then closed.
@performance_1279_h2 @performance_1280_h2
#PolePosition Benchmark #PolePosition Benchmark
@performance_1280_p @performance_1281_p
#The PolePosition is an open source benchmark. The algorithms are all quite simple. It was developed / sponsored by db4o. #The PolePosition is an open source benchmark. The algorithms are all quite simple. It was developed / sponsored by db4o.
@performance_1281_th @performance_1282_th
#Test Case #Test Case
@performance_1282_th @performance_1283_th
#Unit #Unit
@performance_1283_th @performance_1284_th
H2 H2
@performance_1284_th @performance_1285_th
HSQLDB HSQLDB
@performance_1285_th @performance_1286_th
MySQL MySQL
@performance_1286_td @performance_1287_td
#Melbourne write #Melbourne write
@performance_1287_td @performance_1288_td
#ms #ms
@performance_1288_td @performance_1289_td
#369 #369
@performance_1289_td @performance_1290_td
#249 #249
@performance_1290_td @performance_1291_td
#2022 #2022
@performance_1291_td @performance_1292_td
#Melbourne read #Melbourne read
@performance_1292_td @performance_1293_td
#ms #ms
@performance_1293_td @performance_1294_td
#47 #47
@performance_1294_td @performance_1295_td
#49 #49
@performance_1295_td @performance_1296_td
#93 #93
@performance_1296_td @performance_1297_td
#Melbourne read_hot #Melbourne read_hot
@performance_1297_td @performance_1298_td
#ms #ms
@performance_1298_td @performance_1299_td
#24 #24
@performance_1299_td @performance_1300_td
#43 #43
@performance_1300_td @performance_1301_td
#95 #95
@performance_1301_td @performance_1302_td
#Melbourne delete #Melbourne delete
@performance_1302_td @performance_1303_td
#ms #ms
@performance_1303_td @performance_1304_td
#147 #147
@performance_1304_td @performance_1305_td
#133 #133
@performance_1305_td @performance_1306_td
#176 #176
@performance_1306_td @performance_1307_td
#Sepang write #Sepang write
@performance_1307_td @performance_1308_td
#ms #ms
@performance_1308_td @performance_1309_td
#965 #965
@performance_1309_td @performance_1310_td
#1201 #1201
@performance_1310_td @performance_1311_td
#3213 #3213
@performance_1311_td @performance_1312_td
#Sepang read #Sepang read
@performance_1312_td @performance_1313_td
#ms #ms
@performance_1313_td @performance_1314_td
#765 #765
@performance_1314_td @performance_1315_td
#948 #948
@performance_1315_td @performance_1316_td
#3455 #3455
@performance_1316_td @performance_1317_td
#Sepang read_hot #Sepang read_hot
@performance_1317_td @performance_1318_td
#ms #ms
@performance_1318_td @performance_1319_td
#789 #789
@performance_1319_td @performance_1320_td
#859 #859
@performance_1320_td @performance_1321_td
#3563 #3563
@performance_1321_td @performance_1322_td
#Sepang delete #Sepang delete
@performance_1322_td @performance_1323_td
#ms #ms
@performance_1323_td @performance_1324_td
#1384 #1384
@performance_1324_td @performance_1325_td
#1596 #1596
@performance_1325_td @performance_1326_td
#6214 #6214
@performance_1326_td @performance_1327_td
#Bahrain write #Bahrain write
@performance_1327_td @performance_1328_td
#ms #ms
@performance_1328_td @performance_1329_td
#1186 #1186
@performance_1329_td @performance_1330_td
#1387 #1387
@performance_1330_td @performance_1331_td
#6904 #6904
@performance_1331_td @performance_1332_td
#Bahrain query_indexed_string #Bahrain query_indexed_string
@performance_1332_td @performance_1333_td
#ms #ms
@performance_1333_td @performance_1334_td
#336 #336
@performance_1334_td @performance_1335_td
#170 #170
@performance_1335_td @performance_1336_td
#693 #693
@performance_1336_td @performance_1337_td
#Bahrain query_string #Bahrain query_string
@performance_1337_td @performance_1338_td
#ms #ms
@performance_1338_td @performance_1339_td
#18064 #18064
@performance_1339_td @performance_1340_td
#39703 #39703
@performance_1340_td @performance_1341_td
#41243 #41243
@performance_1341_td @performance_1342_td
#Bahrain query_indexed_int #Bahrain query_indexed_int
@performance_1342_td @performance_1343_td
#ms #ms
@performance_1343_td @performance_1344_td
#104 #104
@performance_1344_td @performance_1345_td
#134 #134
@performance_1345_td @performance_1346_td
#678 #678
@performance_1346_td @performance_1347_td
#Bahrain update #Bahrain update
@performance_1347_td @performance_1348_td
#ms #ms
@performance_1348_td @performance_1349_td
#191 #191
@performance_1349_td @performance_1350_td
#87 #87
@performance_1350_td @performance_1351_td
#159 #159
@performance_1351_td @performance_1352_td
#Bahrain delete #Bahrain delete
@performance_1352_td @performance_1353_td
#ms #ms
@performance_1353_td @performance_1354_td
#1215 #1215
@performance_1354_td @performance_1355_td
#729 #729
@performance_1355_td @performance_1356_td
#6812 #6812
@performance_1356_td @performance_1357_td
#Imola retrieve #Imola retrieve
@performance_1357_td @performance_1358_td
#ms #ms
@performance_1358_td @performance_1359_td
#198 #198
@performance_1359_td @performance_1360_td
#194 #194
@performance_1360_td @performance_1361_td
#4036 #4036
@performance_1361_td @performance_1362_td
#Barcelona write #Barcelona write
@performance_1362_td @performance_1363_td
#ms #ms
@performance_1363_td @performance_1364_td
#413 #413
@performance_1364_td @performance_1365_td
#832 #832
@performance_1365_td @performance_1366_td
#3191 #3191
@performance_1366_td @performance_1367_td
#Barcelona read #Barcelona read
@performance_1367_td @performance_1368_td
#ms #ms
@performance_1368_td @performance_1369_td
#119 #119
@performance_1369_td @performance_1370_td
#160 #160
@performance_1370_td @performance_1371_td
#1177 #1177
@performance_1371_td @performance_1372_td
#Barcelona query #Barcelona query
@performance_1372_td @performance_1373_td
#ms #ms
@performance_1373_td @performance_1374_td
#20 #20
@performance_1374_td @performance_1375_td
#5169 #5169
@performance_1375_td @performance_1376_td
#101 #101
@performance_1376_td @performance_1377_td
#Barcelona delete #Barcelona delete
@performance_1377_td @performance_1378_td
#ms #ms
@performance_1378_td @performance_1379_td
#388 #388
@performance_1379_td @performance_1380_td
#319 #319
@performance_1380_td @performance_1381_td
#3287 #3287
@performance_1381_td @performance_1382_td
#Total #Total
@performance_1382_td @performance_1383_td
#ms #ms
@performance_1383_td @performance_1384_td
#26724 #26724
@performance_1384_td @performance_1385_td
#53962 #53962
@performance_1385_td @performance_1386_td
#87112 #87112
@performance_1386_p @performance_1387_p
#There are a few problems with the PolePosition test: #There are a few problems with the PolePosition test:
@performance_1387_li @performance_1388_li
#HSQLDB uses in-memory tables by default while H2 uses persistent tables. The HSQLDB version included in PolePosition does not support changing this, so you need to replace poleposition-0.20/lib/hsqldb.jar with a newer version (for example hsqldb-1.8.0.7.jar), and then use the setting hsqldb.connecturl=jdbc:hsqldb:file:data/hsqldb/dbbench2;hsqldb.default_table_type=cached;sql.enforce_size=true in Jdbc.properties. #HSQLDB uses in-memory tables by default while H2 uses persistent tables. The HSQLDB version included in PolePosition does not support changing this, so you need to replace poleposition-0.20/lib/hsqldb.jar with a newer version (for example hsqldb-1.8.0.7.jar), and then use the setting hsqldb.connecturl=jdbc:hsqldb:file:data/hsqldb/dbbench2;hsqldb.default_table_type=cached;sql.enforce_size=true in Jdbc.properties.
@performance_1388_li @performance_1389_li
#HSQLDB keeps the database open between tests, while H2 closes the database (losing all the cache). To change that, use the database URL jdbc:h2:file:data/h2/dbbench;DB_CLOSE_DELAY=-1 #HSQLDB keeps the database open between tests, while H2 closes the database (losing all the cache). To change that, use the database URL jdbc:h2:file:data/h2/dbbench;DB_CLOSE_DELAY=-1
@performance_1389_li @performance_1390_li
#The amount of cache memory is quite important, specially for the PolePosition test. Unfortunately, the PolePosition test does not take this into account. #The amount of cache memory is quite important, specially for the PolePosition test. Unfortunately, the PolePosition test does not take this into account.
@performance_1390_h2 @performance_1391_h2
#Application Profiling #Application Profiling
@performance_1391_h3 @performance_1392_h3
#Analyze First #Analyze First
@performance_1392_p @performance_1393_p
#Before trying to optimize performance, it is important to understand where the problem is (what part of the application is slow). Blind optimization or optimization based on guesses should be avoided, because usually it is not an efficient strategy. There are various ways to analyze an application. Sometimes two implementations can be compared using System.currentTimeMillis(). But this does not work for complex applications with many modules, and for memory problems. #Before trying to optimize performance, it is important to understand where the problem is (what part of the application is slow). Blind optimization or optimization based on guesses should be avoided, because usually it is not an efficient strategy. There are various ways to analyze an application. Sometimes two implementations can be compared using System.currentTimeMillis(). But this does not work for complex applications with many modules, and for memory problems.
@performance_1393_p @performance_1394_p
#A good tool to measure both memory usage and performance is the <a href="http://www.yourkit.com">YourKit Java Profiler</a> . #A good tool to measure both memory usage and performance is the <a href="http://www.yourkit.com">YourKit Java Profiler</a> .
@performance_1394_p @performance_1395_p
#A simple way to profile an application is to use the built-in profiling tool of java. Example: #A simple way to profile an application is to use the built-in profiling tool of java. Example:
@performance_1395_p @performance_1396_p
#Unfortunately, it is only possible to profile the application from start to end. Another solution is to create a number of full thread dumps. To do that, first run <code>jps -l</code> to get the process id, and then run <code>jstack &lt;pid&gt;</code> or <code>kill -QUIT &lt;pid&gt;</code> (Linux) or press Ctrl+C (Windows). #Unfortunately, it is only possible to profile the application from start to end. Another solution is to create a number of full thread dumps. To do that, first run <code>jps -l</code> to get the process id, and then run <code>jstack &lt;pid&gt;</code> or <code>kill -QUIT &lt;pid&gt;</code> (Linux) or press Ctrl+C (Windows).
@performance_1396_h2 @performance_1397_h2
#Database Profiling #Database Profiling
@performance_1397_p @performance_1398_p
#The ConvertTraceFile tool generates SQL statement statistics at the end of the SQL script file. The format used is similar to the profiling data generated when using java -Xrunhprof. As an example, execute the the following script using the H2 Console: #The ConvertTraceFile tool generates SQL statement statistics at the end of the SQL script file. The format used is similar to the profiling data generated when using java -Xrunhprof. As an example, execute the the following script using the H2 Console:
@performance_1398_p @performance_1399_p
#Now convert the .trace.db file using the ConvertTraceFile tool: #Now convert the .trace.db file using the ConvertTraceFile tool:
@performance_1399_p @performance_1400_p
#The generated file <code>test.sql</code> will contain the SQL statements as well as the following profiling data (results vary): #The generated file <code>test.sql</code> will contain the SQL statements as well as the following profiling data (results vary):
@performance_1400_h2 @performance_1401_h2
#Database Performance Tuning #Database Performance Tuning
@performance_1401_h3 @performance_1402_h3
#Virus Scanners #Virus Scanners
@performance_1402_p @performance_1403_p
#Some virus scanners scan files every time they are accessed. It is very important for performance that database files are not scanned for viruses. The database engine does never interprets the data stored in the files as programs, that means even if somebody would store a virus in a database file, this would be harmless (when the virus does not run, it cannot spread). Some virus scanners allow to exclude files by suffix. Make sure files ending with .db are not scanned. #Some virus scanners scan files every time they are accessed. It is very important for performance that database files are not scanned for viruses. The database engine does never interprets the data stored in the files as programs, that means even if somebody would store a virus in a database file, this would be harmless (when the virus does not run, it cannot spread). Some virus scanners allow to exclude files by suffix. Make sure files ending with .db are not scanned.
@performance_1403_h3 @performance_1404_h3
トレースオプションを使用する トレースオプションを使用する
@performance_1404_p @performance_1405_p
#If the main performance hot spots are in the database engine, in many cases the performance can be optimized by creating additional indexes, or changing the schema. Sometimes the application does not directly generate the SQL statements, for example if an O/R mapping tool is used. To view the SQL statements and JDBC API calls, you can use the trace options. For more information, see <a href="features.html#trace_options">Using the Trace Options</a> . #If the main performance hot spots are in the database engine, in many cases the performance can be optimized by creating additional indexes, or changing the schema. Sometimes the application does not directly generate the SQL statements, for example if an O/R mapping tool is used. To view the SQL statements and JDBC API calls, you can use the trace options. For more information, see <a href="features.html#trace_options">Using the Trace Options</a> .
@performance_1405_h3 @performance_1406_h3
#Index Usage #Index Usage
@performance_1406_p @performance_1407_p
#This database uses indexes to improve the performance of SELECT, UPDATE and DELETE statements. If a column is used in the WHERE clause of a query, and if an index exists on this column, then the index can be used. Multi-column indexes are used if all or the first columns of the index are used. Both equality lookup and range scans are supported. Indexes are used to order result sets, but only if the condition uses the same index or no index at all. The results are sorted in memory if required. Indexes are created automatically for primary key and unique constraints. Indexes are also created for foreign key constraints, if required. For other columns, indexes need to be created manually using the CREATE INDEX statement. #This database uses indexes to improve the performance of SELECT, UPDATE and DELETE statements. If a column is used in the WHERE clause of a query, and if an index exists on this column, then the index can be used. Multi-column indexes are used if all or the first columns of the index are used. Both equality lookup and range scans are supported. Indexes are used to order result sets, but only if the condition uses the same index or no index at all. The results are sorted in memory if required. Indexes are created automatically for primary key and unique constraints. Indexes are also created for foreign key constraints, if required. For other columns, indexes need to be created manually using the CREATE INDEX statement.
@performance_1407_h3 @performance_1408_h3
#Optimizer #Optimizer
@performance_1408_p @performance_1409_p
#This database uses a cost based optimizer. For simple and queries and queries with medium complexity (less than 7 tables in the join), the expected cost (running time) of all possible plans is calculated, and the plan with the lowest cost is used. For more complex queries, the algorithm first tries all possible combinations for the first few tables, and the remaining tables added using a greedy algorithm (this works well for most joins). Afterwards a genetic algorithm is used to test at most 2000 distinct plans. Only left-deep plans are evaluated. #This database uses a cost based optimizer. For simple and queries and queries with medium complexity (less than 7 tables in the join), the expected cost (running time) of all possible plans is calculated, and the plan with the lowest cost is used. For more complex queries, the algorithm first tries all possible combinations for the first few tables, and the remaining tables added using a greedy algorithm (this works well for most joins). Afterwards a genetic algorithm is used to test at most 2000 distinct plans. Only left-deep plans are evaluated.
@performance_1409_h3 @performance_1410_h3
#Expression Optimization #Expression Optimization
@performance_1410_p @performance_1411_p
#After the statement is parsed, all expressions are simplified automatically if possible. Operations are evaluated only once if all parameters are constant. Functions are also optimized, but only if the function is constant (always returns the same result for the same parameter values). If the WHERE clause is always false, then the table is not accessed at all. #After the statement is parsed, all expressions are simplified automatically if possible. Operations are evaluated only once if all parameters are constant. Functions are also optimized, but only if the function is constant (always returns the same result for the same parameter values). If the WHERE clause is always false, then the table is not accessed at all.
@performance_1411_h3 @performance_1412_h3
#COUNT(*) Optimization #COUNT(*) Optimization
@performance_1412_p @performance_1413_p
#If the query only counts all rows of a table, then the data is not accessed. However, this is only possible if no WHERE clause is used, that means it only works for queries of the form SELECT COUNT(*) FROM table. #If the query only counts all rows of a table, then the data is not accessed. However, this is only possible if no WHERE clause is used, that means it only works for queries of the form SELECT COUNT(*) FROM table.
@performance_1413_h3 @performance_1414_h3
#Updating Optimizer Statistics / Column Selectivity #Updating Optimizer Statistics / Column Selectivity
@performance_1414_p @performance_1415_p
#When executing a query, at most one index per joined table can be used. If the same table is joined multiple times, for each join only one index is used. Example: for the query SELECT * FROM TEST T1, TEST T2 WHERE T1.NAME='A' AND T2.ID=T1.ID, two index can be used, in this case the index on NAME for T1 and the index on ID for T2. #When executing a query, at most one index per joined table can be used. If the same table is joined multiple times, for each join only one index is used. Example: for the query SELECT * FROM TEST T1, TEST T2 WHERE T1.NAME='A' AND T2.ID=T1.ID, two index can be used, in this case the index on NAME for T1 and the index on ID for T2.
@performance_1415_p @performance_1416_p
#If a table has multiple indexes, sometimes more than one index could be used. Example: if there is a table TEST(ID, NAME, FIRSTNAME) and an index on each column, then two indexes could be used for the query SELECT * FROM TEST WHERE NAME='A' AND FIRSTNAME='B', the index on NAME or the index on FIRSTNAME. It is not possible to use both indexes at the same time. Which index is used depends on the selectivity of the column. The selectivity describes the 'uniqueness' of values in a column. A selectivity of 100 means each value appears only once, and a selectivity of 1 means the same value appears in many or most rows. For the query above, the index on NAME should be used if the table contains more distinct names than first names. #If a table has multiple indexes, sometimes more than one index could be used. Example: if there is a table TEST(ID, NAME, FIRSTNAME) and an index on each column, then two indexes could be used for the query SELECT * FROM TEST WHERE NAME='A' AND FIRSTNAME='B', the index on NAME or the index on FIRSTNAME. It is not possible to use both indexes at the same time. Which index is used depends on the selectivity of the column. The selectivity describes the 'uniqueness' of values in a column. A selectivity of 100 means each value appears only once, and a selectivity of 1 means the same value appears in many or most rows. For the query above, the index on NAME should be used if the table contains more distinct names than first names.
@performance_1416_p @performance_1417_p
#The SQL statement ANALYZE can be used to automatically estimate the selectivity of the columns in the tables. This command should be run from time to time to improve the query plans generated by the optimizer. #The SQL statement ANALYZE can be used to automatically estimate the selectivity of the columns in the tables. This command should be run from time to time to improve the query plans generated by the optimizer.
@performance_1417_h3 @performance_1418_h3
#Optimization Examples #Optimization Examples
@performance_1419_p
#See <code>src/test/org/h2/samples/optimizations.sql</code> for a few examples of queries that benefit from special optimizations built into the database.
@performance_1420_h3
#Cache Size and Type
@performance_1421_p
#By default the cache size of H2 is quite small. Consider using a larger cache size, or enable the second level soft reference cache. See also <a href="features.html#cache_settings">Cache Settings</a> .
@performance_1422_h2
#Fast Database Import
@performance_1423_p
#To speed up large imports, consider using the following options temporarily:
@performance_1424_li
#SET CACHE_SIZE (a large cache is faster)
@performance_1418_p @performance_1425_li
#See <code>src/test/org/h2/samples/optimizations.sql</code> for a few examples of queries that benefit from special optimizations built into the database. #SET LOCK_MODE 0 (disable locking)
@performance_1419_h3 @performance_1426_li
#Cache Size and Type #SET LOG 0 (disable the transaction log)
@performance_1420_p @performance_1427_li
#By default the cache size of H2 is quite small. Consider using a larger cache size, or enable the second level soft reference cache. See also <a href="features.html#cache_settings">Cache Settings</a> . #SET UNDO_LOG 0 (disable the session undo log)
@performance_1428_p
#These options can be set in the database URL: <code>jdbc:h2:~/test;CACHE_SIZE=65536;LOCK_MODE=0;LOG=0;UNDO_LOG=0</code> . Most of those options are not recommended for regular use, that means you need to reset them after use.
@quickstart_1000_h1 @quickstart_1000_h1
クイックスタート クイックスタート
...@@ -7507,7 +7531,7 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -7507,7 +7531,7 @@ SQLコマンドがコマンドエリアに表示されます。
#Test multi-threaded in-memory db access #Test multi-threaded in-memory db access
@roadmap_1019_li @roadmap_1019_li
#MVCC: Select for update should only lock the selected rows. #MVCC: select for update should only lock the selected rows.
@roadmap_1020_li @roadmap_1020_li
#Option to shutdown all the running servers (on the same VM). #Option to shutdown all the running servers (on the same VM).
...@@ -7684,7 +7708,7 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -7684,7 +7708,7 @@ SQLコマンドがコマンドエリアに表示されます。
#Server: client ping from time to time (to avoid timeout - is timeout a problem?) #Server: client ping from time to time (to avoid timeout - is timeout a problem?)
@roadmap_1078_li @roadmap_1078_li
#Copy database: Tool with config GUI and batch mode, extensible (example: compare) #Copy database: tool with config GUI and batch mode, extensible (example: compare)
@roadmap_1079_li @roadmap_1079_li
#Document, implement tool for long running transactions using user-defined compensation statements. #Document, implement tool for long running transactions using user-defined compensation statements.
...@@ -7696,16 +7720,16 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -7696,16 +7720,16 @@ SQLコマンドがコマンドエリアに表示されます。
#GCJ: what is the state now? #GCJ: what is the state now?
@roadmap_1082_li @roadmap_1082_li
#Events for: Database Startup, Connections, Login attempts, Disconnections, Prepare (after parsing), Web Server (see http://docs.openlinksw.com/virtuoso/fn_dbev_startup.html) #Events for: database Startup, Connections, Login attempts, Disconnections, Prepare (after parsing), Web Server (see http://docs.openlinksw.com/virtuoso/fn_dbev_startup.html)
@roadmap_1083_li @roadmap_1083_li
#Optimization: Log compression #Optimization: log compression
@roadmap_1084_li @roadmap_1084_li
#Support standard INFORMATION_SCHEMA tables, as defined in http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt; specially KEY_COLUMN_USAGE (http://dev.mysql.com/doc/refman/5.0/en/information-schema.html, http://www.xcdsql.org/Misc/INFORMATION_SCHEMA%20With%20Rolenames.gif) #Support standard INFORMATION_SCHEMA tables, as defined in http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt; specially KEY_COLUMN_USAGE (http://dev.mysql.com/doc/refman/5.0/en/information-schema.html, http://www.xcdsql.org/Misc/INFORMATION_SCHEMA%20With%20Rolenames.gif)
@roadmap_1085_li @roadmap_1085_li
#Compatibility: in MySQL, HSQLDB, /0.0 is NULL; in PostgreSQL, Derby: Division by zero #Compatibility: in MySQL, HSQLDB, /0.0 is NULL; in PostgreSQL, Derby: division by zero
@roadmap_1086_li @roadmap_1086_li
#Functional tables should accept parameters from other tables (see FunctionMultiReturn) SELECT * FROM TEST T, P2C(T.A, T.R) #Functional tables should accept parameters from other tables (see FunctionMultiReturn) SELECT * FROM TEST T, P2C(T.A, T.R)
...@@ -7723,10 +7747,10 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -7723,10 +7747,10 @@ SQLコマンドがコマンドエリアに表示されます。
#EXE file: maybe use http://jsmooth.sourceforge.net #EXE file: maybe use http://jsmooth.sourceforge.net
@roadmap_1091_li @roadmap_1091_li
#Performance: Automatically build in-memory indexes if the whole table is in memory #Performance: automatically build in-memory indexes if the whole table is in memory
@roadmap_1092_li @roadmap_1092_li
#H2 Console: The webclient could support more features like phpMyAdmin. #H2 Console: the webclient could support more features like phpMyAdmin.
@roadmap_1093_li @roadmap_1093_li
#Use Janino to convert Java to C++ #Use Janino to convert Java to C++
...@@ -7741,7 +7765,7 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -7741,7 +7765,7 @@ SQLコマンドがコマンドエリアに表示されます。
#Support Oracle CONNECT BY in some way: http://www.adp-gmbh.ch/ora/sql/connect_by.html, http://philip.greenspun.com/sql/trees.html #Support Oracle CONNECT BY in some way: http://www.adp-gmbh.ch/ora/sql/connect_by.html, http://philip.greenspun.com/sql/trees.html
@roadmap_1097_li @roadmap_1097_li
#SQL Server 2005, Oracle: Support COUNT(*) OVER(). See http://www.orafusion.com/art_anlytc.htm #SQL Server 2005, Oracle: support COUNT(*) OVER(). See http://www.orafusion.com/art_anlytc.htm
@roadmap_1098_li @roadmap_1098_li
#RANK() and DENSE_RANK(), Partition using OVER() #RANK() and DENSE_RANK(), Partition using OVER()
...@@ -7786,10 +7810,10 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -7786,10 +7810,10 @@ SQLコマンドがコマンドエリアに表示されます。
#Document ROWNUM usage for reports: SELECT ROWNUM, * FROM (subquery) #Document ROWNUM usage for reports: SELECT ROWNUM, * FROM (subquery)
@roadmap_1112_li @roadmap_1112_li
#Clustering: Reads should be randomly distributed or to a designated database on RAM #Clustering: reads should be randomly distributed or to a designated database on RAM
@roadmap_1113_li @roadmap_1113_li
#Clustering: When a database is back alive, automatically synchronize with the master #Clustering: when a database is back alive, automatically synchronize with the master
@roadmap_1114_li @roadmap_1114_li
#Standalone tool to get relevant system properties and add it to the trace output. #Standalone tool to get relevant system properties and add it to the trace output.
...@@ -7801,10 +7825,10 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -7801,10 +7825,10 @@ SQLコマンドがコマンドエリアに表示されます。
#JAMon (proxy jdbc driver) #JAMon (proxy jdbc driver)
@roadmap_1117_li @roadmap_1117_li
#Console: Improve editing data (Tab, Shift-Tab, Enter, Up, Down, Shift+Del?) #Console: improve editing data (Tab, Shift-Tab, Enter, Up, Down, Shift+Del?)
@roadmap_1118_li @roadmap_1118_li
#Console: Autocomplete Ctrl+Space inserts template #Console: autocomplete Ctrl+Space inserts template
@roadmap_1119_li @roadmap_1119_li
#Simplify translation ('Donate a translation') #Simplify translation ('Donate a translation')
...@@ -7867,7 +7891,7 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -7867,7 +7891,7 @@ SQLコマンドがコマンドエリアに表示されます。
#Console: -ifExists doesn't work for the console. Add a flag to disable other dbs #Console: -ifExists doesn't work for the console. Add a flag to disable other dbs
@roadmap_1139_li @roadmap_1139_li
#Performance: Update in-place #Performance: update in-place
@roadmap_1140_li @roadmap_1140_li
#Check if 'FSUTIL behavior set disablelastaccess 1' improves the performance (fsutil behavior query disablelastaccess) #Check if 'FSUTIL behavior set disablelastaccess 1' improves the performance (fsutil behavior query disablelastaccess)
...@@ -8035,7 +8059,7 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -8035,7 +8059,7 @@ SQLコマンドがコマンドエリアに表示されます。
#Run benchmarks with JDK 1.5, JDK 1.6, java -server #Run benchmarks with JDK 1.5, JDK 1.6, java -server
@roadmap_1195_li @roadmap_1195_li
#Optimizations: Faster hash function for strings, byte arrays #Optimizations: faster hash function for strings, byte arrays
@roadmap_1196_li @roadmap_1196_li
#DatabaseEventListener: callback for all operations (including expected time, RUNSCRIPT) and cancel functionality #DatabaseEventListener: callback for all operations (including expected time, RUNSCRIPT) and cancel functionality
...@@ -8089,7 +8113,7 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -8089,7 +8113,7 @@ SQLコマンドがコマンドエリアに表示されます。
#Check state of H2 driver for DDLUtils: https://issues.apache.org/jira/browse/DDLUTILS-185 #Check state of H2 driver for DDLUtils: https://issues.apache.org/jira/browse/DDLUTILS-185
@roadmap_1213_li @roadmap_1213_li
#Support JMX: Create an MBean for each database and server (support JConsole). See http://thedevcloud.blogspot.com/2008/10/displaying-hsql-database-manager-in.html http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer() http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html #Support JMX: create an MBean for each database and server (support JConsole). See http://thedevcloud.blogspot.com/2008/10/displaying-hsql-database-manager-in.html http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer() http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html
@roadmap_1214_li @roadmap_1214_li
#Index usage for REGEXP LIKE. #Index usage for REGEXP LIKE.
...@@ -8104,7 +8128,7 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -8104,7 +8128,7 @@ SQLコマンドがコマンドエリアに表示されます。
#Access rights: remember the owner of an object. COMMENT: allow owner of object to change it. #Access rights: remember the owner of an object. COMMENT: allow owner of object to change it.
@roadmap_1218_li @roadmap_1218_li
#Access rights: Finer grained access control (grant access for specific functions) #Access rights: finer grained access control (grant access for specific functions)
@roadmap_1219_li @roadmap_1219_li
#Support N'text' #Support N'text'
...@@ -8158,7 +8182,7 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -8158,7 +8182,7 @@ SQLコマンドがコマンドエリアに表示されます。
#Sequence: PostgreSQL compatibility (rename, create) (http://www.postgresql.org/docs/8.2/static/sql-altersequence.html) #Sequence: PostgreSQL compatibility (rename, create) (http://www.postgresql.org/docs/8.2/static/sql-altersequence.html)
@roadmap_1236_li @roadmap_1236_li
#DISTINCT: Support large result sets by sorting on all columns (additionally) and then removing duplicates. #DISTINCT: support large result sets by sorting on all columns (additionally) and then removing duplicates.
@roadmap_1237_li @roadmap_1237_li
#File system that writes to two file systems (replicating file system) #File system that writes to two file systems (replicating file system)
...@@ -8185,7 +8209,7 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -8185,7 +8209,7 @@ SQLコマンドがコマンドエリアに表示されます。
#Support COSH, SINH, and TANH functions #Support COSH, SINH, and TANH functions
@roadmap_1245_li @roadmap_1245_li
#FTP Server: Implement SFTP / FTPS #FTP Server: implement SFTP / FTPS
@roadmap_1246_li @roadmap_1246_li
#Native search: support "phrase search", wildcard search (* and ?), case-insensitive search, boolean operators, and grouping #Native search: support "phrase search", wildcard search (* and ?), case-insensitive search, boolean operators, and grouping
...@@ -8245,408 +8269,411 @@ SQLコマンドがコマンドエリアに表示されます。 ...@@ -8245,408 +8269,411 @@ SQLコマンドがコマンドエリアに表示されます。
#HSQLDB compatibility: Openfire server uses: CREATE SCHEMA PUBLIC AUTHORIZATION DBA; CREATE USER SA PASSWORD ""; GRANT DBA TO SA; SET SCHEMA PUBLIC #HSQLDB compatibility: Openfire server uses: CREATE SCHEMA PUBLIC AUTHORIZATION DBA; CREATE USER SA PASSWORD ""; GRANT DBA TO SA; SET SCHEMA PUBLIC
@roadmap_1265_li @roadmap_1265_li
#Web site: Rename Performance to Comparison [/Compatibility], move Comparison to Other Database Engines to Comparison, move Products that Work with H2 to Comparison, move Performance Tuning to Advanced Topics #Translation: use ?? in help.csv
@roadmap_1266_li @roadmap_1266_li
#Translation: use ?? in help.csv #Translated .pdf
@roadmap_1267_li @roadmap_1267_li
#Translated .pdf #Cluster: hot deploy (adding a node at runtime)
@roadmap_1268_li @roadmap_1268_li
#Cluster: hot deploy (adding a node at runtime) #MySQL compatibility: update test1 t1, test2 t2 set t1.id = t2.id where t1.id = t2.id;
@roadmap_1269_li @roadmap_1269_li
#MySQL compatibility: update test1 t1, test2 t2 set t1.id = t2.id where t1.id = t2.id; #Recovery tool: bad blocks should be converted to INSERT INTO SYSTEM_ERRORS(...), and things should go into the .trace.db file
@roadmap_1270_li @roadmap_1270_li
#Recovery tool: bad blocks should be converted to INSERT INTO SYSTEM_ERRORS(...), and things should go into the .trace.db file #RECOVER=2 to backup the database, run recovery, open the database
@roadmap_1271_li @roadmap_1271_li
#RECOVER=2 to backup the database, run recovery, open the database #Recovery should work with encrypted databases
@roadmap_1272_li @roadmap_1272_li
#Recovery should work with encrypted databases #Corruption: new error code, add help
@roadmap_1273_li @roadmap_1273_li
#Corruption: new error code, add help #Space reuse: after init, scan all storages and free those that don't belong to a live database object
@roadmap_1274_li @roadmap_1274_li
#Space reuse: after init, scan all storages and free those that don't belong to a live database object #SysProperties: change everything to H2_...
@roadmap_1275_li @roadmap_1275_li
#SysProperties: change everything to H2_... #Use FilterIn / FilterOut putStream?
@roadmap_1276_li @roadmap_1276_li
#Use FilterIn / FilterOut putStream? #Access rights: add missing features (users should be 'owner' of objects; missing rights for sequences; dropping objects)
@roadmap_1277_li @roadmap_1277_li
#Access rights: add missing features (users should be 'owner' of objects; missing rights for sequences; dropping objects) #Support NOCACHE table option (Oracle)
@roadmap_1278_li @roadmap_1278_li
#Support NOCACHE table option (Oracle) #Support table partitioning.
@roadmap_1279_li @roadmap_1279_li
#Support table partitioning. #Index usage for UPDATE ... WHERE .. IN (SELECT...)
@roadmap_1280_li @roadmap_1280_li
#Index usage for UPDATE ... WHERE .. IN (SELECT...) #Add regular javadocs (using the default doclet, but another css) to the homepage.
@roadmap_1281_li @roadmap_1281_li
#Add regular javadocs (using the default doclet, but another css) to the homepage. #The database should be kept open for a longer time when using the server mode.
@roadmap_1282_li @roadmap_1282_li
#The database should be kept open for a longer time when using the server mode. #Javadocs: for each tool, add a copy &amp; paste sample in the class level.
@roadmap_1283_li @roadmap_1283_li
#Javadocs: for each tool, add a copy &amp; paste sample in the class level. #Javadocs: add @author tags.
@roadmap_1284_li @roadmap_1284_li
#Javadocs: add @author tags. #Fluent API for tools: Server.createTcpServer().setPort(9081).setPassword(password).start();
@roadmap_1285_li @roadmap_1285_li
#Fluent API for tools: Server.createTcpServer().setPort(9081).setPassword(password).start(); #MySQL compatibility: real SQL statement for DESCRIBE TEST
@roadmap_1286_li @roadmap_1286_li
#MySQL compatibility: real SQL statement for DESCRIBE TEST #Use a default delay of 1 second before closing a database.
@roadmap_1287_li @roadmap_1287_li
#Use a default delay of 1 second before closing a database. #Write (log) to system table before adding to internal data structures.
@roadmap_1288_li @roadmap_1288_li
#Write (log) to system table before adding to internal data structures. #Support very large deletes and updates.
@roadmap_1289_li @roadmap_1289_li
#Support very large deletes and updates. #Doclet (javadocs): constructors are not listed.
@roadmap_1290_li @roadmap_1290_li
#Doclet (javadocs): constructors are not listed. #Support direct lookup for MIN and MAX when using WHERE (see todo.txt / Direct Lookup).
@roadmap_1291_li @roadmap_1291_li
#Support direct lookup for MIN and MAX when using WHERE (see todo.txt / Direct Lookup). #Support other array types (String[], double[]) in PreparedStatement.setObject(int, Object);
@roadmap_1292_li @roadmap_1292_li
#Support other array types (String[], double[]) in PreparedStatement.setObject(int, Object); #MVCC should not be memory bound (uncommitted data is kept in memory in the delta index; maybe using a regular btree index solves the problem).
@roadmap_1293_li @roadmap_1293_li
#MVCC should not be memory bound (uncommitted data is kept in memory in the delta index; maybe using a regular btree index solves the problem). #Oracle compatibility: support NLS_DATE_FORMAT.
@roadmap_1294_li @roadmap_1294_li
#Oracle compatibility: support NLS_DATE_FORMAT. #Support flashback queries as in Oracle.
@roadmap_1295_li @roadmap_1295_li
#Support flashback queries as in Oracle. #Import / Export of fixed with text files.
@roadmap_1296_li @roadmap_1296_li
#Import / Export of fixed with text files. #Support OUT parameters in user-defined procedures.
@roadmap_1297_li @roadmap_1297_li
#Support OUT parameters in user-defined procedures. #Support getGeneratedKeys to return multiple rows when used with batch updates. This is supported by MySQL, but not Derby. Both PostgreSQL and HSQLDB don't support getGeneratedKeys. Also support it when using INSERT ... SELECT.
@roadmap_1298_li @roadmap_1298_li
#Support getGeneratedKeys to return multiple rows when used with batch updates. This is supported by MySQL, but not Derby. Both PostgreSQL and HSQLDB don't support getGeneratedKeys. Also support it when using INSERT ... SELECT. #HSQLDB compatibility: automatic data type for SUM if value is the value is too big (by default use the same type as the data).
@roadmap_1299_li @roadmap_1299_li
#HSQLDB compatibility: automatic data type for SUM if value is the value is too big (by default use the same type as the data). #Improve the optimizer to select the right index for special cases: where id between 2 and 4 and booleanColumn
@roadmap_1300_li @roadmap_1300_li
#Improve the optimizer to select the right index for special cases: where id between 2 and 4 and booleanColumn #Linked tables: make hidden columns available (Oracle: rowid and ora_rowscn columns).
@roadmap_1301_li @roadmap_1301_li
#Linked tables: make hidden columns available (Oracle: rowid and ora_rowscn columns). #Support merge join.
@roadmap_1302_li @roadmap_1302_li
#Support merge join. #H2 Console: in-place autocomplete.
@roadmap_1303_li @roadmap_1303_li
#H2 Console: in-place autocomplete. #Oracle: support DECODE method (convert to CASE WHEN).
@roadmap_1304_li @roadmap_1304_li
#Oracle: support DECODE method (convert to CASE WHEN). #Support large databases: split LOB (BLOB, CLOB) to multiple directories / disks (similar to tablespaces).
@roadmap_1305_li @roadmap_1305_li
#Support large databases: split LOB (BLOB, CLOB) to multiple directories / disks (similar to tablespaces). #Support to assign a primary key index a user defined name.
@roadmap_1306_li @roadmap_1306_li
#Support to assign a primary key index a user defined name. #Cluster: add feature to make sure cluster nodes can not get out of sync (for example by stopping one process).
@roadmap_1307_li @roadmap_1307_li
#Cluster: Add feature to make sure cluster nodes can not get out of sync (for example by stopping one process). #H2 Console: support configuration option for fixed width (monospace) font.
@roadmap_1308_li @roadmap_1308_li
#H2 Console: support configuration option for fixed width (monospace) font. #Native fulltext search: support analyzers (specially for Chinese, Japanese).
@roadmap_1309_li @roadmap_1309_li
#Native fulltext search: support analyzers (specially for Chinese, Japanese). #Automatically compact databases from time to time (as a background process).
@roadmap_1310_li @roadmap_1310_li
#Automatically compact databases from time to time (as a background process). #Support SCOPE_IDENTITY().
@roadmap_1311_li @roadmap_1311_li
#Support SCOPE_IDENTITY(). #Support GRANT SELECT, UPDATE ON *.
@roadmap_1312_li @roadmap_1312_li
#Support GRANT SELECT, UPDATE ON *. #Test Eclipse DTP.
@roadmap_1313_li @roadmap_1313_li
#Test Eclipse DTP. #H2 Console: autocomplete: keep the previous setting
@roadmap_1314_li @roadmap_1314_li
#H2 Console: autocomplete: keep the previous setting #MySQL, MS SQL Server compatibility: support case sensitive (mixed case) identifiers without quotes.
@roadmap_1315_li @roadmap_1315_li
#MySQL, MS SQL Server compatibility: support case sensitive (mixed case) identifiers without quotes. #executeBatch: option to stop at the first failed statement.
@roadmap_1316_li @roadmap_1316_li
#executeBatch: option to stop at the first failed statement. #Implement OLAP features as described here: http://www.devx.com/getHelpOn/10MinuteSolution/16573/0/page/5
@roadmap_1317_li @roadmap_1317_li
#Implement OLAP features as described here: http://www.devx.com/getHelpOn/10MinuteSolution/16573/0/page/5 #Support Oracle ROWID (unique identifier for each row).
@roadmap_1318_li @roadmap_1318_li
#Support Oracle ROWID (unique identifier for each row). #Server mode: improve performance for batch updates.
@roadmap_1319_li @roadmap_1319_li
#Server mode: Improve performance for batch updates. #Applets: support read-only databases in a zip file (accessed as a resource).
@roadmap_1320_li @roadmap_1320_li
#Applets: Support read-only databases in a zip file (accessed as a resource). #Long running queries / errors / trace system table.
@roadmap_1321_li @roadmap_1321_li
#Long running queries / errors / trace system table. #H2 Console should support JaQu directly.
@roadmap_1322_li @roadmap_1322_li
#H2 Console should support JaQu directly. #H2 Console: support single file upload and directory download (optional).
@roadmap_1323_li @roadmap_1323_li
#H2 Console: support single file upload and directory download (optional). #Document FTL_SEARCH, FTL_SEARCH_DATA.
@roadmap_1324_li @roadmap_1324_li
#Document FTL_SEARCH, FTL_SEARCH_DATA. #Sequences: CURRVAL should be session specific. Compatibility with PostgreSQL.
@roadmap_1325_li @roadmap_1325_li
#Sequences: CURRVAL should be session specific. Compatibility with PostgreSQL. #Support DatabaseMetaData.insertsAreDetected: updatable result sets should detect inserts.
@roadmap_1326_li @roadmap_1326_li
#Support DatabaseMetaData.insertsAreDetected: updatable result sets should detect inserts. #Auto-server: add option to define the IP address range or list.
@roadmap_1327_li @roadmap_1327_li
#Auto-server: add option to define the IP address range or list. #Index creation only using deterministic functions.
@roadmap_1328_li @roadmap_1328_li
#Index creation only using deterministic functions. #Use http://recaptcha.net somehow to secure the Google Group.
@roadmap_1329_li @roadmap_1329_li
#Use http://recaptcha.net somehow to secure the Google Group. #Support DELETE with TOP or LIMIT. See also: http://dev.mysql.com/doc/refman/5.1/de/delete.html
@roadmap_1330_li @roadmap_1330_li
#Support DELETE with TOP or LIMIT. See also: http://dev.mysql.com/doc/refman/5.1/de/delete.html #Change the default for NULL || 'x' to return NULL
@roadmap_1331_li @roadmap_1331_li
#Change the default for NULL || 'x' to return NULL #ANALYZE: use a bloom filter for each indexed column to estimate count of distinct values.
@roadmap_1332_li @roadmap_1332_li
#ANALYZE: Use a bloom filter for each indexed column to estimate count of distinct values. #ANALYZE: for unique indexes that allow null, count the number of null.
@roadmap_1333_li @roadmap_1333_li
#ANALYZE: For unique indexes that allow null, count the number of null. #AUTO_SERVER: support changing IP addresses (disable a network while the database is open).
@roadmap_1334_li @roadmap_1334_li
#AUTO_SERVER: support changing IP addresses (disable a network while the database is open). #Avoid using java.util.Calendar internally because it's slow, complicated, and seems to be buggy.
@roadmap_1335_li @roadmap_1335_li
#Avoid using java.util.Calendar internally because it's slow, complicated, and seems to be buggy. #Support TRUNCATE .. CASCADE like PostgreSQL.
@roadmap_1336_li @roadmap_1336_li
#Support TRUNCATE .. CASCADE like PostgreSQL. #Support opening a database that is in the classpath, maybe using a new file system.
@roadmap_1337_li @roadmap_1337_li
#Support opening a database that is in the classpath, maybe using a new file system. #Fulltext search: lazy result generation using SimpleRowSource.
@roadmap_1338_li @roadmap_1338_li
#Fulltext search: lazy result generation using SimpleRowSource. #Support transformation to join for user defined functions, as for IN(SELECT...).
@roadmap_1339_li @roadmap_1339_li
#Support transformation to join for user defined functions, as for IN(SELECT...). #Fulltext search: support alternative syntax: WHERE FTL_CONTAINS(name, 'hello').
@roadmap_1340_li @roadmap_1340_li
#Fulltext search: Support alternative syntax: WHERE FTL_CONTAINS(name, 'hello'). #MySQL compatibility: support REPLACE, see http://dev.mysql.com/doc/refman/5.1/de/replace.html
@roadmap_1341_li @roadmap_1341_li
#MySQL compatibility: support REPLACE, see http://dev.mysql.com/doc/refman/5.1/de/replace.html #MySQL compatibility: support INSERT INTO table SET column1 = value1, column2 = value2
@roadmap_1342_li @roadmap_1342_li
#MySQL compatibility: support INSERT INTO table SET column1 = value1, column2 = value2 #Docs: add a one line description for each functions and SQL statements at the top (in the link section).
@roadmap_1343_li @roadmap_1343_li
#Docs: Add a one line description for each functions and SQL statements at the top (in the link section). #Javadoc search: weight for titles should be higher ('random' should list Functions as the best match).
@roadmap_1344_li @roadmap_1344_li
#Javadoc search: weight for titles should be higher ('random' should list Functions as the best match). #Replace information_schema tables with regular tables that are automatically re-built when needed. Use indexes.
@roadmap_1345_li @roadmap_1345_li
#Replace information_schema tables with regular tables that are automatically re-built when needed. Use indexes. #Support a special trigger on all tables.
@roadmap_1346_li @roadmap_1346_li
#Support a special trigger on all tables. #Delete temporary files or objects using finalize.
@roadmap_1347_li @roadmap_1347_li
#Delete temporary files or objects using finalize. #Oracle compatibility: support calling 0-parameters functions without parenthesis. Make constants obsolete.
@roadmap_1348_li @roadmap_1348_li
#Oracle compatibility: support calling 0-parameters functions without parenthesis. Make constants obsolete. #MySQL, HSQLDB compatibility: support where 'a'=1 (not supported by Derby, PostgreSQL)
@roadmap_1349_li @roadmap_1349_li
#MySQL, HSQLDB compatibility: support where 'a'=1 (not supported by Derby, PostgreSQL) #Allow calling function with no parameters without parenthesis. See http://code.google.com/p/h2database/issues/detail?id=50
@roadmap_1350_li @roadmap_1350_li
#Allow calling function with no parameters without parenthesis. See http://code.google.com/p/h2database/issues/detail?id=50 #CSV: currently # is a line comment and can start at any field. Make it optional.
@roadmap_1351_li @roadmap_1351_li
#CSV: currently # is a line comment and can start at any field. Make it optional. #Add database creation date and time to the database.
@roadmap_1352_li @roadmap_1352_li
#Add database creation date and time to the database. #Support ASSERTIONS.
@roadmap_1353_li @roadmap_1353_li
#Support ASSERTIONS. #MySQL compatibility: support comparing 1='a'
@roadmap_1354_li @roadmap_1354_li
#MySQL compatibility: support comparing 1='a' #Support PostgreSQL lock modes: http://www.postgresql.org/docs/8.3/static/explicit-locking.html
@roadmap_1355_li @roadmap_1355_li
#Support PostgreSQL lock modes: http://www.postgresql.org/docs/8.3/static/explicit-locking.html #PostgreSQL compatibility: test DbVisualizer and Squirrel SQL using a new PostgreSQL JDBC driver.
@roadmap_1356_li @roadmap_1356_li
#PostgreSQL compatibility: test DbVisualizer and Squirrel SQL using a new PostgreSQL JDBC driver. #RunScript should be able to read from system in (or quite mode for Shell).
@roadmap_1357_li @roadmap_1357_li
#RunScript should be able to read from system in (or quite mode for Shell). #Natural join: support select x from dual natural join dual.
@roadmap_1358_li @roadmap_1358_li
#Natural join: support select x from dual natural join dual. #Natural join: somehow support this: select a.x, b.x, x from dual a natural join dual b
@roadmap_1359_li @roadmap_1359_li
#Natural join: somehow support this: select a.x, b.x, x from dual a natural join dual b #MySQL compatibility: for auto_increment columns, convert 0 to next value (as when inserting NULL).
@roadmap_1360_li @roadmap_1360_li
#MySQL compatibility: for auto_increment columns, convert 0 to next value (as when inserting NULL). #Functions: support hashcode(value); cryptographic and fast
@roadmap_1361_li @roadmap_1361_li
#Functions: support hashcode(value); cryptographic and fast #Serialized file lock: support long running queries.
@roadmap_1362_li @roadmap_1362_li
#Serialized file lock: support long running queries. #Network: use 127.0.0.1 if other addresses don't work.
@roadmap_1363_li @roadmap_1363_li
#Network: use 127.0.0.1 if other addresses don't work. #Select for update in mvcc mode: only lock the selected records.
@roadmap_1364_li @roadmap_1364_li
#Select for update in mvcc mode: only lock the selected records. #Support reading JCR data: one table per node type; query table; cache option
@roadmap_1365_li @roadmap_1365_li
#Support reading JCR data: one table per node type; query table; cache option #OSGi: create a sample application, test, document.
@roadmap_1366_li @roadmap_1366_li
#OSGi: create a sample application, test, document. #help.csv: use complete examples for functions; run as test case.
@roadmap_1367_li @roadmap_1367_li
#help.csv: use complete examples for functions; run as test case. #Re-implement PooledConnection; use a lightweight connection object.
@roadmap_1368_li @roadmap_1368_li
#Re-implement PooledConnection; use a lightweight connection object. #Doclet: convert tests in javadocs to a java class.
@roadmap_1369_li @roadmap_1369_li
#Doclet: convert tests in javadocs to a java class. #Doclet: format fields like methods, but support sorting by name and value.
@roadmap_1370_li @roadmap_1370_li
#Doclet: format fields like methods, but support sorting by name and value. #Doclet: shrink the html files.
@roadmap_1371_li @roadmap_1371_li
#Doclet: shrink the html files. #Finer granularity for SLF4J trace - See http://code.google.com/p/h2database/issues/detail?id=62
@roadmap_1372_li @roadmap_1372_li
#Finer granularity for SLF4J trace - See http://code.google.com/p/h2database/issues/detail?id=62 #MySQL compatibility: support REPLACE - See http://code.google.com/p/h2database/issues/detail?id=73
@roadmap_1373_li @roadmap_1373_li
#MySQL compatibility: support REPLACE - See http://code.google.com/p/h2database/issues/detail?id=73 #MySQL compatibility: support SET NAMES 'latin1' - See also http://code.google.com/p/h2database/issues/detail?id=56
@roadmap_1374_li @roadmap_1374_li
#MySQL compatibility: support SET NAMES 'latin1' - See also http://code.google.com/p/h2database/issues/detail?id=56 #MySQL compatibility: DELETE .. FROM .. USING - See http://dev.mysql.com/doc/refman/5.0/en/delete.html
@roadmap_1375_li @roadmap_1375_li
#MySQL compatibility: DELETE .. FROM .. USING - See http://dev.mysql.com/doc/refman/5.0/en/delete.html #Allow to scan index backwards starting with a value (to better support ORDER BY DESC).
@roadmap_1376_li @roadmap_1376_li
#Allow to scan index backwards starting with a value (to better support ORDER BY DESC). #Java Service Wrapper: try http://yajsw.sourceforge.net/
@roadmap_1377_li @roadmap_1377_li
#Java Service Wrapper: try http://yajsw.sourceforge.net/ #Batch parameter for INSERT, UPDATE, and DELETE, and commit after each batch. See also MySQL DELETE.
@roadmap_1378_li @roadmap_1378_li
#Batch parameter for INSERT, UPDATE, and DELETE, and commit after each batch. See also MySQL DELETE. #MySQL compatibility: support ALTER TABLE .. MODIFY COLUMN.
@roadmap_1379_li @roadmap_1379_li
#MySQL compatibility: support ALTER TABLE .. MODIFY COLUMN. #Use a lazy and auto-close input stream (open resource when reading, close on eof).
@roadmap_1380_li @roadmap_1380_li
#Use a lazy and auto-close input stream (open resource when reading, close on eof). #PostgreSQL compatibility: generate_series.
@roadmap_1381_li @roadmap_1381_li
#PostgreSQL compatibility: generate_series. #Connection pool: 'reset session' command (delete temp tables, rollback, autocommit true).
@roadmap_1382_li @roadmap_1382_li
#Connection pool: 'reset session' command (delete temp tables, rollback, autocommit true). #Improve SQL documentation, see http://www.w3schools.com/sql/
@roadmap_1383_li @roadmap_1383_li
#Improve SQL documentation, see http://www.w3schools.com/sql/ #MySQL compatibility: DatabaseMetaData.stores*() methods should return the same values. Test with SquirrelSQL.
@roadmap_1384_li @roadmap_1384_li
#MySQL compatibility: DatabaseMetaData.stores*() methods should return the same values. Test with SquirrelSQL. #MS SQL Server compatibility: support DATEPART syntax.
@roadmap_1385_li @roadmap_1385_li
#MS SQL Server compatibility: support DATEPART syntax. #Oracle compatibility: support CREATE OR REPLACE VIEW syntax.
@roadmap_1386_li @roadmap_1386_li
#Oracle compatibility: support CREATE OR REPLACE VIEW syntax. #Sybase/DB2/Oracle compatibility: support out parameters in stored procedures - See http://code.google.com/p/h2database/issues/detail?id=83
@roadmap_1387_li @roadmap_1387_li
#Sybase/DB2/Oracle compatibility: support out parameters in stored procedures - See http://code.google.com/p/h2database/issues/detail?id=83 #Support INTERVAL data type (see Oracle and others).
@roadmap_1388_li @roadmap_1388_li
#Support INTERVAL data type (see Oracle and others). #Combine Server and Console tool (only keep Server).
@roadmap_1389_li @roadmap_1389_li
#Combine Server and Console tool (only keep Server). #Store the Lucene index in the database itself.
@roadmap_1390_li @roadmap_1390_li
#Store the Lucene index in the database itself. #Oracle compatibility: support DECODE(x, ...).
@roadmap_1391_li @roadmap_1391_li
#Oracle compatibility: support DECODE(x, ...). #Console: Start Browser: if ip number changed, try localhost instead.
@roadmap_1392_li @roadmap_1392_li
#Console: Start Browser: if ip number changed, try localhost instead. #MVCC: compare concurrent update behavior with PostgreSQL and Oracle.
@roadmap_1393_li @roadmap_1393_li
#MVCC: compare concurrent update behavior with PostgreSQL and Oracle. #HSQLDB compatibility: CREATE FUNCTION (maybe using a Function interface).
@roadmap_1394_li @roadmap_1394_li
#HSQLDB compatibility: CREATE FUNCTION (maybe using a Function interface). #HSQLDB compatibility: support CALL "java.lang.Math.sqrt"(2.0)
@roadmap_1395_li @roadmap_1395_li
#HSQLDB compatibility: support CALL "java.lang.Math.sqrt"(2.0) #Support comma as the decimal separator in the CSV tool.
@roadmap_1396_li @roadmap_1396_li
#Support comma as the decimal separator in the CSV tool. #Compatibility: Java functions with SQLJ Part1 http://www.acm.org/sigmod/record/issues/9912/standards.pdf.gz
@roadmap_1397_li
#Compatibility: Java functions with SQL/PSM (Persistent Stored Modules) - need to find the documentation.
@roadmap_1397_h2 @roadmap_1398_h2
#Not Planned #Not Planned
@roadmap_1398_li @roadmap_1399_li
#HSQLDB (did) support this: select id i from test where i&lt;0 (other databases don't). Supporting it may break compatibility. #HSQLDB (did) support this: select id i from test where i&lt;0 (other databases don't). Supporting it may break compatibility.
@roadmap_1399_li @roadmap_1400_li
#String.intern (so that Strings can be compared with ==) will not be used because some VMs have problems when used extensively. #String.intern (so that Strings can be compared with ==) will not be used because some VMs have problems when used extensively.
@sourceError_1000_h1 @sourceError_1000_h1
...@@ -8860,7 +8887,7 @@ Javaをテストする ...@@ -8860,7 +8887,7 @@ Javaをテストする
データベースドライバの追加 データベースドライバの追加
@tutorial_1057_p @tutorial_1057_p
H2DRIVERSかCLASSPATHの環境変数に、ドライバのJarファイルの位置を追加することにより、データベースドライバの追加を行うことができます。 例 (Windowsの場合): データベースドライバのライブラリに C:\Programs\hsqldb\lib\hsqldb.jar を追加し、H2DRIVERSの環境変数に C:\Programs\hsqldb\lib\hsqldb.jar を設定します。 #Additional database drivers can be registered by adding the Jar file location of the driver to the environment variables H2DRIVERS or CLASSPATH. Example (Windows): to add the database driver library C:\Programs\hsqldb\lib\hsqldb.jar, set the environment variable H2DRIVERS to C:\Programs\hsqldb\lib\hsqldb.jar.
@tutorial_1058_p @tutorial_1058_p
複数のドライバを設定することも可能です; それぞれのパスは ';' (Windows) や ':' (他のOS) で区切ります。 パス名内のスペースは有効です。設定は引用されません。 複数のドライバを設定することも可能です; それぞれのパスは ';' (Windows) や ':' (他のOS) で区切ります。 パス名内のスペースは有効です。設定は引用されません。
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -34,7 +34,7 @@ adminTranslateStart=Translate ...@@ -34,7 +34,7 @@ adminTranslateStart=Translate
helpAction=Action helpAction=Action
helpAddAnotherRow=Add another row helpAddAnotherRow=Add another row
helpAddDrivers=Adding Database Drivers helpAddDrivers=Adding Database Drivers
helpAddDriversText=Additional database drivers can be registered by adding the Jar file location of the driver to the the environment variables H2DRIVERS or CLASSPATH. Example (Windows)\: To add the database driver library C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, set the environment variable H2DRIVERS to C\:\\Programs\\hsqldb\\lib\\hsqldb.jar. helpAddDriversText=Additional database drivers can be registered by adding the Jar file location of the driver to the the environment variables H2DRIVERS or CLASSPATH. Example (Windows)\: to add the database driver library C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, set the environment variable H2DRIVERS to C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=Add a new row helpAddRow=Add a new row
helpCommandHistory=Shows the Command History helpCommandHistory=Shows the Command History
helpCreateTable=Create a new table helpCreateTable=Create a new table
......
...@@ -243,7 +243,7 @@ public class FullText { ...@@ -243,7 +243,7 @@ public class FullText {
/** /**
* Searches from the full text index for this database. * Searches from the full text index for this database.
* The returned result set has the following column: * The returned result set has the following column:
* <ul><li>QUERY (varchar): The query to use to get the data. * <ul><li>QUERY (varchar): the query to use to get the data.
* The query does not include 'SELECT * FROM '. Example: * The query does not include 'SELECT * FROM '. Example:
* PUBLIC.TEST WHERE ID = 1 * PUBLIC.TEST WHERE ID = 1
* </li></ul> * </li></ul>
...@@ -263,11 +263,11 @@ public class FullText { ...@@ -263,11 +263,11 @@ public class FullText {
* the primary key data as an array. The returned result set has the * the primary key data as an array. The returned result set has the
* following columns: * following columns:
* <ul> * <ul>
* <li>SCHEMA (varchar): The schema name. Example: PUBLIC </li> * <li>SCHEMA (varchar): the schema name. Example: PUBLIC </li>
* <li>TABLE (varchar): The table name. Example: TEST </li> * <li>TABLE (varchar): the table name. Example: TEST </li>
* <li>COLUMNS (array of varchar): Comma separated list of quoted column * <li>COLUMNS (array of varchar): comma separated list of quoted column
* names. The column names are quoted if necessary. Example: (ID) </li> * names. The column names are quoted if necessary. Example: (ID) </li>
* <li>KEYS (array of values): Comma separated list of values. Example: (1) * <li>KEYS (array of values): comma separated list of values. Example: (1)
* </li> * </li>
* </ul> * </ul>
* *
......
...@@ -166,7 +166,7 @@ public class FullTextLucene extends FullText { ...@@ -166,7 +166,7 @@ public class FullTextLucene extends FullText {
/** /**
* Searches from the full text index for this database. * Searches from the full text index for this database.
* The returned result set has the following column: * The returned result set has the following column:
* <ul><li>QUERY (varchar): The query to use to get the data. * <ul><li>QUERY (varchar): the query to use to get the data.
* The query does not include 'SELECT * FROM '. Example: * The query does not include 'SELECT * FROM '. Example:
* PUBLIC.TEST WHERE ID = 1 * PUBLIC.TEST WHERE ID = 1
* </li></ul> * </li></ul>
...@@ -188,11 +188,11 @@ public class FullTextLucene extends FullText { ...@@ -188,11 +188,11 @@ public class FullTextLucene extends FullText {
* the primary key data as an array. The returned result set has the * the primary key data as an array. The returned result set has the
* following columns: * following columns:
* <ul> * <ul>
* <li>SCHEMA (varchar): The schema name. Example: PUBLIC </li> * <li>SCHEMA (varchar): the schema name. Example: PUBLIC </li>
* <li>TABLE (varchar): The table name. Example: TEST </li> * <li>TABLE (varchar): the table name. Example: TEST </li>
* <li>COLUMNS (array of varchar): Comma separated list of quoted column * <li>COLUMNS (array of varchar): comma separated list of quoted column
* names. The column names are quoted if necessary. Example: (ID) </li> * names. The column names are quoted if necessary. Example: (ID) </li>
* <li>KEYS (array of values): Comma separated list of values. Example: (1) * <li>KEYS (array of values): comma separated list of values. Example: (1)
* </li> * </li>
* </ul> * </ul>
* *
......
...@@ -54,7 +54,7 @@ import java.sql.SQLClientInfoException; ...@@ -54,7 +54,7 @@ import java.sql.SQLClientInfoException;
* Represents a connection (session) to a database. * Represents a connection (session) to a database.
* </p> * </p>
* <p> * <p>
* Thread safety: The connection is thread-safe, because access * Thread safety: the connection is thread-safe, because access
* is synchronized. However, for compatibility with other databases, a * is synchronized. However, for compatibility with other databases, a
* connection should only be used in one thread at any time. * connection should only be used in one thread at any time.
* </p> * </p>
...@@ -591,11 +591,11 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -591,11 +591,11 @@ public class JdbcConnection extends TraceObject implements Connection {
* one, except if the level is not supported. Internally, this method calls * one, except if the level is not supported. Internally, this method calls
* SET LOCK_MODE. The following isolation levels are supported: * SET LOCK_MODE. The following isolation levels are supported:
* <ul> * <ul>
* <li> Connection.TRANSACTION_READ_UNCOMMITTED = SET LOCK_MODE 0: No * <li> Connection.TRANSACTION_READ_UNCOMMITTED = SET LOCK_MODE 0: no
* locking (should only be used for testing). </li> * locking (should only be used for testing). </li>
* <li>Connection.TRANSACTION_SERIALIZABLE = SET LOCK_MODE 1: Table level * <li>Connection.TRANSACTION_SERIALIZABLE = SET LOCK_MODE 1: table level
* locking. </li> * locking. </li>
* <li>Connection.TRANSACTION_READ_COMMITTED = SET LOCK_MODE 3: Table * <li>Connection.TRANSACTION_READ_COMMITTED = SET LOCK_MODE 3: table
* level locking, but read locks are released immediately (default). </li> * level locking, but read locks are released immediately (default). </li>
* </ul> * </ul>
* This setting is not persistent. Please note that using * This setting is not persistent. Please note that using
......
...@@ -230,7 +230,7 @@ public class JdbcConnectionPool implements DataSource { ...@@ -230,7 +230,7 @@ public class JdbcConnectionPool implements DataSource {
/** /**
* This method usually puts the connection back into the pool. There are * This method usually puts the connection back into the pool. There are
* some exception: If the pool is disposed, the connection is disposed as * some exceptions: if the pool is disposed, the connection is disposed as
* well. If the pool is full, the connection is closed. * well. If the pool is full, the connection is closed.
* *
* @param pc the pooled connection * @param pc the pooled connection
......
...@@ -543,7 +543,7 @@ DROP ALL OBJECTS [DELETE FILES] ...@@ -543,7 +543,7 @@ DROP ALL OBJECTS [DELETE FILES]
Drops all existing views, tables, sequences, schemas, function aliases, roles, Drops all existing views, tables, sequences, schemas, function aliases, roles,
user-defined aggregate functions, domains, and users (except the current user). user-defined aggregate functions, domains, and users (except the current user).
If DELETE FILES is specified, the database files will be removed when the last If DELETE FILES is specified, the database files will be removed when the last
user disconnects from the database. Warning: This command can not be rolled user disconnects from the database. Warning: this command can not be rolled
back. Admin rights are required to execute this command. back. Admin rights are required to execute this command.
"," ","
DROP ALL OBJECTS DROP ALL OBJECTS
...@@ -975,7 +975,7 @@ data and index changes are enabled. ...@@ -975,7 +975,7 @@ data and index changes are enabled.
Transaction logging can be disabled to improve the performance when durability Transaction logging can be disabled to improve the performance when durability
is not important, for example while running tests or when loading the database. is not important, for example while running tests or when loading the database.
Warning: It may not be possible to recover the database if logging is disabled Warning: it may not be possible to recover the database if logging is disabled
and the application terminates abnormally. If logging of index changes is and the application terminates abnormally. If logging of index changes is
enabled, opening a database that was crashed becomes faster because the indexes enabled, opening a database that was crashed becomes faster because the indexes
don't need to be rebuilt. don't need to be rebuilt.
...@@ -2846,7 +2846,8 @@ CASEWHEN(ID=1, 'A', 'B') ...@@ -2846,7 +2846,8 @@ CASEWHEN(ID=1, 'A', 'B')
"Functions (System)","CAST"," "Functions (System)","CAST","
CAST(value AS dataType): value CAST(value AS dataType): value
"," ","
Converts a value to another data type. Converts a value to another data type. When converting a text to a number, the default Java conversion
rules are used (prefixes 0x or # for hexadecimal numbers, prefix 0 for octal numbers).
"," ","
CAST(NAME AS INT) CAST(NAME AS INT)
" "
...@@ -2884,12 +2885,16 @@ CSVREAD(fileNameString [, columnNamesString [, charsetString ...@@ -2884,12 +2885,16 @@ CSVREAD(fileNameString [, columnNamesString [, charsetString
[, nullString]]]]]]): resultSet [, nullString]]]]]]): resultSet
"," ","
Returns the result set of reading the CSV (comma separated values) file. For Returns the result set of reading the CSV (comma separated values) file. For
each parameter, NULL means the default value should be used. If the column names each parameter, NULL means the default value should be used.
are specified (a list of column names separated with the fieldSeparator), those
are used they are read from the file, otherwise (or if they are set to NULL) the If the column names are specified (a list of column names separated with the
first line of the file is interpreted as the column names. The default charset fieldSeparator), those are used they are read from the file, otherwise
is the default value for this system, and the default field separator is a (or if they are set to NULL) the first line of the file is interpreted as the column names.
comma. Missing unquoted values as well as data that matches nullString is Column names are case sensitive, that means you need to use quoted identifiers
unless the column names are capitalized (see below).
The default charset is the default value for this system, and the default field separator
is a comma. Missing unquoted values as well as data that matches nullString is
parsed as NULL. All columns of type VARCHAR. parsed as NULL. All columns of type VARCHAR.
This function can be used like a table: SELECT * FROM CSVREAD(...). This function can be used like a table: SELECT * FROM CSVREAD(...).
...@@ -2903,6 +2908,7 @@ CALL CSVREAD('test.csv'); ...@@ -2903,6 +2908,7 @@ CALL CSVREAD('test.csv');
CALL CSVREAD('test2.csv', 'ID|NAME', 'UTF-8', '|'); CALL CSVREAD('test2.csv', 'ID|NAME', 'UTF-8', '|');
-- Read a semicolon-separated file -- Read a semicolon-separated file
SELECT * FROM CSVREAD('data/test.csv', NULL, NULL, ';'); SELECT * FROM CSVREAD('data/test.csv', NULL, NULL, ';');
SELECT ""Last Name"" FROM CSVREAD('address.csv');
" "
"Functions (System)","CSVWRITE"," "Functions (System)","CSVWRITE","
......
...@@ -34,7 +34,7 @@ adminTranslateStart=Translate ...@@ -34,7 +34,7 @@ adminTranslateStart=Translate
helpAction=Action helpAction=Action
helpAddAnotherRow=Add another row helpAddAnotherRow=Add another row
helpAddDrivers=Adding Database Drivers helpAddDrivers=Adding Database Drivers
helpAddDriversText=Additional database drivers can be registered by adding the Jar file location of the driver to the the environment variables H2DRIVERS or CLASSPATH. Example (Windows)\: To add the database driver library C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, set the environment variable H2DRIVERS to C\:\\Programs\\hsqldb\\lib\\hsqldb.jar. helpAddDriversText=Additional database drivers can be registered by adding the Jar file location of the driver to the the environment variables H2DRIVERS or CLASSPATH. Example (Windows)\: to add the database driver library C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, set the environment variable H2DRIVERS to C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=Add a new row helpAddRow=Add a new row
helpCommandHistory=Shows the Command History helpCommandHistory=Shows the Command History
helpCreateTable=Create a new table helpCreateTable=Create a new table
......
...@@ -99,7 +99,7 @@ Initial Developer: H2 Group ...@@ -99,7 +99,7 @@ Initial Developer: H2 Group
In embedded mode, the database runs in the same process as the application. In embedded mode, the database runs in the same process as the application.
Only one process may access a database at any time. Only one process may access a database at any time.
Databases are automatically created if they don't exist. Databases are automatically created if they don't exist.
<b>Warning</b>: If no path is used (for example jdbc:h2:test), <b>Warning</b>: if no path is used (for example jdbc:h2:test),
then the database is stored in the current working directory then the database is stored in the current working directory
(the directory where the application was started). (the directory where the application was started).
URLs of the form jdbc:h2:data/test are relative to URLs of the form jdbc:h2:data/test are relative to
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论