提交 cf646510 authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation.

上级 dd69b685
...@@ -824,7 +824,8 @@ access to the same connection, but other databases may not do this. ...@@ -824,7 +824,8 @@ access to the same connection, but other databases may not do this.
<h3>Locking, Lock-Timeout, Deadlocks</h3> <h3>Locking, Lock-Timeout, Deadlocks</h3>
<p> <p>
The database uses table level locks to give each connection a consistent state of the data. Unless <a href="advanced.html#mvcc">multi-version concurrency</a> is used,
the database uses table level locks to give each connection a consistent state of the data.
There are two kinds of locks: read locks (shared locks) and write locks (exclusive locks). There are two kinds of locks: read locks (shared locks) and write locks (exclusive locks).
All locks are released when the transaction commits or rolls back. All locks are released when the transaction commits or rolls back.
When using the default transaction isolation level 'read committed', read locks are already released after each statement. When using the default transaction isolation level 'read committed', read locks are already released after each statement.
...@@ -882,6 +883,13 @@ The initial lock timeout (that is the timeout used for new connections) can be s ...@@ -882,6 +883,13 @@ The initial lock timeout (that is the timeout used for new connections) can be s
<code>SET DEFAULT_LOCK_TIMEOUT &lt;milliseconds&gt;</code>. The default lock timeout is persistent. <code>SET DEFAULT_LOCK_TIMEOUT &lt;milliseconds&gt;</code>. The default lock timeout is persistent.
</p> </p>
<h3>Avoiding Deadlocks</h3>
<p>
To avoid deadlocks, ensure that all transactions lock the tables in the same order
(for example in alphabetical order), and avoid upgrading read locks to write locks.
Both can be achieved using explicitly locking tables using <code>SELECT ... FOR UPDATE</code>.
</p>
<h2 id="database_file_layout">Database File Layout</h2> <h2 id="database_file_layout">Database File Layout</h2>
<p> <p>
The following files are created for persistent databases: The following files are created for persistent databases:
......
...@@ -246,6 +246,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -246,6 +246,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Javadoc: document design patterns used </li><li>Javadoc: document design patterns used
</li><li>Write an article about SQLInjection (h2/src/docsrc/html/images/SQLInjection.txt) </li><li>Write an article about SQLInjection (h2/src/docsrc/html/images/SQLInjection.txt)
</li><li>Convert SQL-injection-2.txt to html document, include SQLInjection.java sample </li><li>Convert SQL-injection-2.txt to html document, include SQLInjection.java sample
</li><li>MySQL, MS SQL Server compatibility: support case sensitive (mixed case) identifiers without quotes.
</li><li>Support OUT parameters in user-defined procedures. </li><li>Support OUT parameters in user-defined procedures.
</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;
...@@ -289,7 +290,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -289,7 +290,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</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).
</li><li>Test Eclipse DTP. </li><li>Test Eclipse DTP.
</li><li>H2 Console: autocomplete: keep the previous setting </li><li>H2 Console: autocomplete: keep the previous setting
</li><li>MySQL, MS SQL Server compatibility: support case sensitive (mixed case) identifiers without quotes.
</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).
...@@ -495,6 +495,10 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -495,6 +495,10 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Use javax.tools.JavaCompilerTool instead of com.sun.tools.javac.Main </li><li>Use javax.tools.JavaCompilerTool instead of com.sun.tools.javac.Main
</li><li>If a database object was not found in the current schema, but one with the same name existed in another schema, included that in the error message. </li><li>If a database object was not found in the current schema, but one with the same name existed in another schema, included that in the error message.
</li><li>Optimization to use an index for OR when using multiple keys: where (key1 = ? and key2 = ?) OR (key1 = ? and key2 = ?) </li><li>Optimization to use an index for OR when using multiple keys: where (key1 = ? and key2 = ?) OR (key1 = ? and key2 = ?)
</li><li>Support optimizing queries with both inner and outer joins, as in:
select * from test a inner join test b on a.id=b.id inner join o on o.id=a.id where b.x=1
(the optimizer should swap a and b here).
See also TestNestedJoins, tag "swapInnerJoinTables".
</li><li>JaQu should support a DataSource and a way to create a Db object using a Connection (for multi-threaded usage with a connection pool). </li><li>JaQu should support a DataSource and a way to create a Db object using a Connection (for multi-threaded usage with a connection pool).
</li><li>Move table to a different schema (rename table to a different schema), possibly using ALTER TABLE ... SET SCHEMA ...; </li><li>Move table to a different schema (rename table to a different schema), possibly using ALTER TABLE ... SET SCHEMA ...;
</li><li>nioMapped file system: automatically fall back to regular (non mapped) IO if there is a problem (out of memory exception for example). </li><li>nioMapped file system: automatically fall back to regular (non mapped) IO if there is a problem (out of memory exception for example).
...@@ -518,10 +522,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -518,10 +522,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>CLOB: support random access when reading (this is harder than for BLOB as data is stored in UTF-8 form). </li><li>CLOB: support random access when reading (this is harder than for BLOB as data is stored in UTF-8 form).
</li><li>Compatibility: support SELECT INTO (as an alias for CREATE TABLE ... AS SELECT ...). </li><li>Compatibility: support SELECT INTO (as an alias for CREATE TABLE ... AS SELECT ...).
</li><li>Compatibility with MySQL: support SELECT INTO OUTFILE (cannot be an existing file) as an alias for CSVWRITE(...). </li><li>Compatibility with MySQL: support SELECT INTO OUTFILE (cannot be an existing file) as an alias for CSVWRITE(...).
</li><li>Support optimizing queries with both inner and outer joins, as in:
select * from test a inner join test b on a.id=b.id inner join o on o.id=a.id where b.x=1
(the optimizer should swap a and b here).
See also TestNestedJoins.
</li><li>Compatibility with MySQL: support non-strict mode (sql_mode = "") any data </li><li>Compatibility with MySQL: support non-strict mode (sql_mode = "") any data
that is too large for the column will just be truncated or set to the default value. that is too large for the column will just be truncated or set to the default value.
</li><li>The full condition should be sent to the linked table, not just the indexed condition. </li><li>The full condition should be sent to the linked table, not just the indexed condition.
......
...@@ -285,17 +285,18 @@ public class TestNestedJoins extends TestBase { ...@@ -285,17 +285,18 @@ public class TestNestedJoins extends TestBase {
assertTrue("nested", sql.indexOf("(") >= 0); assertTrue("nested", sql.indexOf("(") >= 0);
stat.execute("drop table a, b, c"); stat.execute("drop table a, b, c");
// see roadmap, tag: swapInnerJoinTables
/* /*
create table test(id int primary key, x int) create table test(id int primary key, x int)
as select x, x from system_range(1, 10); as select x, x from system_range(1, 10);
create index on test(x); create index on test(x);
create table o(id int primary key) create table o(id int primary key)
as select x from system_range(1, 10); as select x from system_range(1, 10);
explain select * from test a inner join test b explain select * from test a inner join test b
on a.id=b.id left outer join o on o.id=a.id where b.x=1; on a.id=b.id left outer join o on o.id=a.id where b.x=1;
-- expected: no tableScan -- expected: no tableScan
explain select * from test a inner join test b explain select * from test a inner join test b
on a.id=b.id inner join o on o.id=a.id where b.x=1; on a.id=b.id inner join o on o.id=a.id where b.x=1;
-- expected: no tableScan -- expected: no tableScan
drop table test; drop table test;
drop table o; drop table o;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论