提交 5de35fa8 authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation.

上级 7751fa2e
......@@ -1130,7 +1130,7 @@ the data might be lost. It must only be used if this is not a problem, for examp
initially loading a database, or when running tests.
LOG=1 means the transaction log is enabled, but FileDescriptor.sync is disabled.
This setting is about half as fast as with LOG=0. This setting is useful if no protection
This setting is about half as fast as with LOG=0. This setting is useful if no protection
against power failure is required, but the data must be protected against killing the process.
LOG=2 (the default) means the transaction log is enabled, and FileDescriptor.sync is called
......@@ -1202,7 +1202,7 @@ SET MAX_LOG_SIZE int
","
Sets the maximum size of the transaction log, in megabytes. If the log exceeds the
limit, a new stream is created. Old streams (that are not used for recovery) are
freed automatically. The default max size is 2 MB.
freed automatically. The default max size is 16 MB.
Admin rights are required to execute this command.
This command commits an open transaction.
......
......@@ -1065,8 +1065,8 @@ then the iteration count is not required at all.
<p>
The database files can be encrypted using two different algorithms: AES-128 and
XTEA (using 32 rounds). The reasons for supporting XTEA is performance
(XTEA is a bit faster as AES in some environments) and to have an alternative algorithm if AES is suddenly broken.
Please note that the XTEA implementation used in this database only uses 32 rounds
(XTEA is a bit faster as AES in some environments) and to have an alternative algorithm if AES is suddenly broken.
Please note that the XTEA implementation used in this database only uses 32 rounds
and not 64 rounds as recommended by its inventor (as of 2010, the best known attack is on 27 rounds).
</p><p>
When a user tries to connect to an encrypted database, the combination of
......
......@@ -18,23 +18,30 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>The cache was not used efficiently when reading
<ul><li>The default MAX_LOG_SIZE is now 16 MB instead of 2 MB. Some uses cases are 3 times faster now.
</li><li>Improved cache memory usage calculation.
</li><li>Only resources that are actually used are loaded in memory.
This can reduce the memory usage by about 400 KB.
</li><li>Profiling: the jar file can now be installed as an agent using
java -javaagent:h2*.jar - this was be used to more accurately calculate the memory footprint of the cache.
It has no effect when using H2 (using this feature in an application is not needed and not recommended).
</li><li>The cache was not used efficiently when reading
(behaving like a FIFO cache instead of an LRU cache).
</li><li>Storing lobs in the database has been changed. It is now faster.
Unfortunately, the change is not backward compatible; if you have used h2.lobInDatabase before
you will need to re-build the database.
Unfortunately, the change is not backward compatible; if you have used h2.lobInDatabase before
you will need to re-build the database.
</li><li>SHUTDOWN COMPACT is now faster.
</li><li>H2 Console: requesting the status did not always show the window on top of others.
</li><li>H2 Console: on some system, the browser windows got opened when requesting a new one.
</li><li>The built-in profiling tool now uses a default stack depth of 32 elements and a default interval of 10 ms.
</li><li>Database files now grows in 1 MB blocks (and at least 2%) at a time,
</li><li>Database files now grows in 1 MB blocks (and at least 20% at a time),
instead of always 256 KB. This speeds up loading a new database.
</li><li>H2 Console: new built-in command @sleep to help profile another session.
</li><li>For improved performance, LOG=0 and LOG=1 are again supported.
LOG=0 means the transaction log is disabled completely (fastest; for loading a database).
LOG=1 means the transaction log is enabled, but FileDescriptor.sync is disabled (if no protection against power failure is required).
LOG=2 is the default (transaction log is enabled, FileDescriptor.sync for each checkpoint).
</li><li>After deleting a lot of data (for example by dropping or altering tables, or indexes,
</li><li>After deleting a lot of data (for example by dropping or altering tables, or indexes,
or after a large transaction), opening a large database was very slow. Fixed.
</li><li>When killing the process after creating and dropping many tables (specially temporary tables),
the database could not be opened sometimes.
......
......@@ -161,24 +161,21 @@ In addition to that, running out of memory should be avoided.
In older versions, OutOfMemory errors while using the database could corrupt a databases.
</p>
<p>
Some areas of this database are not fully tested.
When using one of those features for production, please ensure your use case
is well tested (if possible with automated test cases).
Those areas are:
This database is well tested using automated test cases. The tests run every night
and run for more than one hour. But not all areas of this database are equally well tested.
When using one of the following features for production, please ensure your use case
is well tested (if possible with automated test cases). The areas that are not well tested are:
</p>
<ul>
<li>Platforms other than Windows XP, Linux, Mac OS X, or JVMs other than Sun 1.5 or 1.6
</li><li>The feature <code>MULTI_THREADED</code>
</li><li>The features <code>AUTO_SERVER</code> and
<code>AUTO_RECONNECT</code>
</li><li>The features <code>AUTO_SERVER</code> and <code>AUTO_RECONNECT</code>
</li><li>The file locking method 'Serialized'
</li><li>The MVCC (multi version concurrency) mode
</li><li>Cluster mode, 2-phase commit, savepoints
</li><li>24/7 operation
</li><li>Some operations on databases larger than 500 MB may be slower than expected
</li><li>The optimizer may not always select the best plan
</li><li>Fulltext search
</li><li>Operations on LOBs over 2 GB
</li><li>Some operations on databases larger than 500 MB may be slower than expected
</li><li>The optimizer may not always select the best plan
</li></ul>
<p>
Areas considered experimental are:
......
......@@ -211,8 +211,8 @@ encrypted using AES-128 and XTEA encryption algorithms
</tr><tr>
<td>Encrypted Database</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes *10</td>
<td class="compareY">Yes *10</td>
<td class="compareN">No</td>
<td class="compareN">No</td>
</tr><tr>
......
......@@ -443,6 +443,30 @@ Indexes are also created for foreign key constraints, if required.
For other columns, indexes need to be created manually using the <code>CREATE INDEX</code> statement.
</p>
<h3>How Data is Stored Internally</h3>
<p>
For persistent databases, if a table is created with a single column primary key of type <code>BIGINT, INT, SMALLINT, TINYINT</code>,
then the data of the table is organized in this way. This is sometimes also called a "clustered index" or
"index organized table".
</p><p>
H2 internally stores table data and indexes in the form of b-trees.
Each b-tree stores entries as a list of unique keys (one or more columns) and data (zero or more columns).
The table data is always organized in the form of a "data b-tree" with a single column key of type <code>long</code>.
If a single column primary key of type <code>BIGINT, INT, SMALLINT, TINYINT</code> is specified when creating the table,
then this column is used as the key of the data b-tree.
If no primary key has been specified, if the primary key column is of another data type,
or if the primary key contains more than one column,
then a hidden auto-increment column of type <code>BIGINT</code> is added to the table,
which is used as the key for the data b-tree.
All other columns of the table are stored within the data area of this data b-tree
(except for large <code>BLOB, CLOB</code> columns, which are stored externally).
</p><p>
For each additional index, one new "index b-tree" is created. The key of this b-tree consists of the indexed columns,
plus the key of the data b-tree. If a primary key is created after the table has been created, or if the primary key
contains multiple column, or if the primary key is not of the data types listed above, then the primary key
is stored in a new index b-tree.
</p>
<h3>Optimizer</h3>
<p>
This database uses a cost based optimizer. For simple and queries and queries with medium complexity
......
......@@ -391,7 +391,7 @@ otherwise they are not parsed correctly. If in doubt, add ';' before the command
@prof_stop;
</td>
<td>
Sleep for a number of seconds. Used to profile a long running query or
Sleep for a number of seconds. Used to profile a long running query or
operation that is running in another session (but in the same process).
</td>
</tr>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -117,6 +117,8 @@ class AggregateData {
case Aggregate.STDDEV_SAMP:
case Aggregate.VAR_POP:
case Aggregate.VAR_SAMP: {
// http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
// http://www.johndcook.com/standard_deviation.html
double x = v.getDouble();
if (count == 1) {
sum = x;
......
......@@ -375,6 +375,10 @@ SET IGNORECASE { TRUE | FALSE }
","
If IGNORECASE is enabled, text columns in newly created tables will be
case-insensitive."
"Commands (Other)","SET LOG","
SET LOCK_MODE int
","
Sets the transaction log mode."
"Commands (Other)","SET LOCK_MODE","
SET LOCK_MODE int
","
......@@ -497,7 +501,7 @@ Returns the first expression where the condition is true."
"Other Grammar","Cipher","
{ AES | XTEA }
","
Two algorithms are supported, AES (AES-128) and XTEA (using 32 rounds)."
Two algorithms are supported: AES (AES-128) and XTEA (using 32 rounds)."
"Other Grammar","Column Definition","
columnName dataType { DEFAULT expression | AS computedColumnExpression } [ [ NOT ] NULL ]
[ { AUTO_INCREMENT | IDENTITY } [ ( startInt [, incrementInt ] ) ] ]
......
......@@ -98,7 +98,8 @@ public class CheckJavadoc {
inComment = true;
}
if (inComment) {
if (line.length() > MAX_COMMENT_LINE_SIZE && !line.trim().startsWith("* http://")) {
if (line.length() > MAX_COMMENT_LINE_SIZE
&& !line.trim().startsWith("* http://")) {
System.out.println("Long line : " + file.getAbsolutePath()
+ " (" + file.getName() + ":" + lineNumber + ")");
errorCount++;
......@@ -107,7 +108,9 @@ public class CheckJavadoc {
inComment = false;
}
}
if (!inComment && line.startsWith("//") && line.length() > MAX_COMMENT_LINE_SIZE) {
if (!inComment && line.startsWith("//")
&& line.length() > MAX_COMMENT_LINE_SIZE
&& !line.trim().startsWith("// http://")) {
System.out.println("Long line: " + file.getAbsolutePath()
+ " (" + file.getName() + ":" + lineNumber + ")");
errorCount++;
......
......@@ -251,6 +251,10 @@ public class SpellChecker {
if (token.startsWith(PREFIX_IGNORE)) {
return;
}
// ignore repeated characters
if (StringUtils.replaceAll(token, token.substring(0, 1), "").length() == 0) {
return;
}
if (addToDictionary) {
dictionary.add(token);
} else {
......
......@@ -652,4 +652,5 @@ pagestore addon defaults introduced customized histogram transact locker activem
iml unified regclass netbeans geqo servername creator eclipsecs cacheable
stacked unable seeking underflow violations evaluates repeats minimalistic
licensing appreciate textbook diligence undergraduate afaik mathematics chris
arrangements bugfix
arrangements bugfix premain longs majority crashing behaving inst inventor
javaagent park accurately adopt consists night equally
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论