提交 76ef88ee authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 b2137b65
......@@ -216,6 +216,13 @@ http://www.h2database.com/html/roadmap.html
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
</tr><tr>
<td>Explain Plan</td>
<td class="compareY">Yes</td>
<td class="compareN">No</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
</tr><tr>
<td>Clustering</td>
<td class="compareY">Yes</td>
<td class="compareN">No</td>
......
......@@ -78,9 +78,82 @@ Welcome to H2, the Java SQL database. The main feature of H2 are:
</td></tr>
<tr><td colspan="3" style="border: 0px; padding: 5px 0px 15px 0px;">
<h3> Performance </h3>
<img src="images/performance.png" alt="Performance comparison" /><br />
Operations/second (higher is better) - <a href="performance.html">More information about this test</a>
<h3>Features</h3>
<table style="width: 425px;"><tr>
<th></th>
<th>H2</th>
<th>Derby</th>
<th>HSQLDB</th>
<th>MySQL</th>
<th>PostgreSQL</th>
</tr><tr>
<td>Pure Java</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
<td class="compareN">No</td>
<td class="compareN">No</td>
</tr><tr>
<td>In-Memory Mode</td>
<td class="compareY">Yes</td>
<td class="compareN">No</td>
<td class="compareY">Yes</td>
<td class="compareN">No</td>
<td class="compareN">No</td>
</tr><tr>
<td>Transaction Isolation</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
<td class="compareN">No</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
</tr><tr>
<td>Cost Based Optimizer</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
<td class="compareN">No</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
</tr><tr>
<td>Encrypted Database</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
<td class="compareN">No</td>
<td class="compareN">No</td>
<td class="compareN">No</td>
</tr><tr>
<td>ODBC Driver</td>
<td class="compareY">Yes</td>
<td class="compareN">No</td>
<td class="compareN">No</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
</tr><tr>
<td>Fulltext Search</td>
<td class="compareY">Yes</td>
<td class="compareN">No</td>
<td class="compareN">No</td>
<td class="compareY">Yes</td>
<td class="compareY">Yes</td>
</tr><tr>
<td>Multi Version Concurrency</td>
<td class="compareY">Yes</td>
<td class="compareN">No</td>
<td class="compareN">No</td>
<td class="compareN">No</td>
<td class="compareY">Yes</td>
</tr><tr>
<td>Footprint (jar/dll size)</td>
<td>~1 MB</td>
<td>~2 MB</td>
<td>~600 KB</td>
<td>~4 MB</td>
<td>~6 MB</td>
</tr>
</table>
<p>
See also the <a href="features.html#comparison">detailed comparison</a>.
</p>
</td></tr>
<tr><td colspan="3" style="border: 0px; background-color: #eee;">
......
......@@ -38,10 +38,9 @@ Of course, patches are always welcome, but are not always applied as is. Patches
<li>Improve test code coverage
</li><li>Fulltext search: support streaming CLOB data.
</li><li>Optimize .. OR .. to IN(..) or UNION if the cost is lower
</li><li>Support OSGi: http://oscar-osgi.sourceforge.net, http://incubator.apache.org/felix/index.html
</li><li>Test multi-threaded in-memory db access
</li><li>MVCC: Select for update should only lock the selected rows.
</li><li>Procedural language / script language (Javascript)
</li><li>Procedural language / script language (Java, Javascript)
</li><li>Option to shutdown all the running servers (on the same VM).
</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)
......@@ -53,7 +52,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Support hints for the optimizer (which index to use, enforce the join order).
</li><li>Change LOB mechanism (less files, keep index of lob files, point to files and row, delete unused files earlier, maybe bundle files into a tar file)
</li><li>Clustering: recovery needs to becomes fully automatic. Global write lock feature.
</li><li>Option for Java functions: [DETERMINISTIC] FOR ...
</li><li>Support mixed clustering mode (one embedded, the other server mode)
</li><li>Sequence: add features [NO] MINVALUE, MAXVALUE, CYCLE
</li><li>Deferred integrity checking (DEFERRABLE INITIALLY DEFERRED)
......@@ -62,13 +60,11 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Migrate database tool (also from other database engines)
</li><li>Optimization: automatic index creation suggestion using the trace file?
</li><li>Compression performance: don't allocate buffers, compress / expand in to out buffer
</li><li>Rebuild index functionality (other than delete the index file)
</li><li>Rebuild index functionality to shrink index size and improve performance
</li><li>Don't use deleteOnExit (bug 4513817: File.deleteOnExit consumes memory)
</li><li>Console: add accesskey to most important commands (A, AREA, BUTTON, INPUT, LABEL, LEGEND, TEXTAREA)
</li><li>Feature: a setting to delete the the log or not (for backup)
</li><li>Test with Sun ASPE1_4; JEE Sun AS PE1.4
</li><li>Support nested outer joins (see todo.txt).
</li><li>Don't write stack traces for common exceptions like duplicate key to the log by default
</li><li>Don't write stack traces for common exceptions like duplicate key to the log by default (exclude list)
</li><li>Test performance again with SQL Server, Oracle, DB2
</li><li>Test with dbmonster (http://dbmonster.kernelpanic.pl/)
</li><li>Test with dbcopy (http://dbcopyplugin.sourceforge.net)
......@@ -89,7 +85,8 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Count index range query (count(*) where id between 10 and 20)
</li><li>Eclipse plugin
</li><li>Asynchronous queries to support publish/subscribe: SELECT ... FOR READ WAIT [maxMillisToWait]
</li><li>Improved fulltext search (reader / tokenizer / filter).
</li><li>Fulltext search Lucene: analyzer configuration.
</li><li>Fulltext search (native): reader / tokenizer / filter.
</li><li>Linked schema using CSV files: one schema for a directory of files; support indexes for CSV files
</li><li>iReport to support H2
</li><li>Implement missing JDBC API (CallableStatement,...)
......@@ -103,7 +100,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Document, implement tool for long running transactions using user-defined compensation statements
</li><li>Support SET TABLE DUAL READONLY
</li><li>GCJ: what is the state now?
</li><li>Reduce disk space usage
</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>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)
......@@ -122,21 +118,16 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</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>SQL 2003 (http://www.wiscorp.com/sql_2003_standard.zip)
</li><li>http://www.jpackage.org
</li><li>Version column (number/sequence and timestamp based)
</li><li>Optimize getGeneratedKey: send last identity after each execute (server).
</li><li>Date: default date is '1970-01-01' (is it 1900-01-01 in the standard / other databases?)
</li><li>Test and document UPDATE TEST SET (ID, NAME) = (SELECT ID*10, NAME || '!' FROM TEST T WHERE T.ID=TEST.ID);
</li><li>Max memory rows / max undo log size: use block count / row size not row count
</li><li>Support 123L syntax as in Java; example: SELECT (2000000000*2)
</li><li>Implement point-in-time recovery
</li><li>Include the version name in the jar file name
</li><li>LIKE: improved version for larger texts (currently using naive search)
</li><li>The Script tool should work with other databases as well
</li><li>Automatically convert to the next 'higher' data type whenever there is an overflow.
</li><li>Throw an exception when the application calls getInt on a Long (optional)
</li><li>Default date format for input and output (local date constants)
</li><li>ValueInt.convertToString and so on (remove Value.convertTo)
</li><li>Support custom Collators
</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
......@@ -374,6 +365,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Option to copy the old version of each changed page once after a checkpoint.
</li><li>H2 Console: support single file upload and directory download (optional).
</li><li>Document FTL_SEARCH, FTL_SEARCH_DATA.
</li><li>Sequences: CURRVAL should be session specific. Compatibility with PostgreSQL.
</li><li>Support DatabaseMetaData.insertsAreDetected: updatable result sets should detect inserts.
</li><li>Auto-server: add option to define the IP address range or list.
</li><li>Open a read-only database but don't share it with other connections. jdbc:h2:~/test;PRIVATE=TRUE
......@@ -411,8 +403,12 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Natural join: somehow support this: select a.x, b.x, x from dual a natural join dual b
</li><li>MySQL compatibility: for auto_increment columns, convert 0 to next value (as when inserting NULL).
</li><li>Functions: support hashcode(value)
</li><li>Sequences: CURRVAL should be session specific. Compatibility with PostgreSQL.
</li><li>Serialized file lock: support long running queries.
</li><li>Network: use 127.0.0.1 if other addresses don't work.
</li><li>Select for update in mvcc mode: only lock the selected records.
</li><li>Support reading JCR data: one table per node type; query table; cache option
</li><li>OSGi: create a sample application, test, document.
</li><li>help.csv: use complete examples for functions; run as test case.
</li></ul>
<h2>Not Planned</h2>
......
......@@ -524,8 +524,7 @@ public class Database implements DataHandler {
// wait until pending changes are written
isReconnectNeeded();
if (SysProperties.PAGE_STORE) {
PageStore store = getPageStore();
store.recover();
getPageStore();
}
if (FileUtils.exists(dataFileName)) {
lobFilesInDirectories &= !ValueLob.existsLobFile(getDatabasePath());
......
......@@ -51,9 +51,10 @@ public class PageScanIndex extends BaseIndex implements RowIndex {
if (headPos == Index.EMPTY_HEAD) {
// new table
headPos = store.allocatePage();
store.addMeta(this, id);
PageDataLeaf root = new PageDataLeaf(this, headPos, Page.ROOT, store.createDataPage());
store.updateRecord(root, true, root.data);
int test;
// } else if (store.isNew()) {
// // the system table for a new database
// PageDataLeaf root = new PageDataLeaf(this, headPos,
......
......@@ -13,6 +13,7 @@ import java.util.HashMap;
import org.h2.constant.ErrorCode;
import org.h2.engine.Database;
import org.h2.engine.Session;
import org.h2.index.Cursor;
import org.h2.index.IndexType;
import org.h2.index.PageScanIndex;
import org.h2.log.SessionState;
......@@ -33,6 +34,7 @@ import org.h2.util.FileUtils;
import org.h2.util.ObjectArray;
import org.h2.util.ObjectUtils;
import org.h2.value.Value;
import org.h2.value.ValueInt;
/**
* This class represents a file that is organized as a number of pages. The
......@@ -136,11 +138,6 @@ public class PageStore implements CacheWriter {
*/
private PageLog[] logs = new PageLog[LOG_COUNT];
/**
* True if this is a new file.
*/
private boolean isNew;
private TableData pageTable;
private PageScanIndex pageIndex;
......@@ -198,13 +195,18 @@ trace.setLevel(TraceSystem.DEBUG);
public void open() throws SQLException {
try {
if (FileUtils.exists(fileName)) {
// existing
file = database.openFile(fileName, accessMode, true);
readHeader();
fileLength = file.length();
pageCount = (int) (fileLength / pageSize);
initLogs();
recover(true);
openPageIndex();
recover(false);
checkpoint();
} else {
isNew = true;
// new
setPageSize(PAGE_SIZE_DEFAULT);
file = database.openFile(fileName, accessMode, false);
systemRootPageId = 1;
......@@ -215,11 +217,9 @@ trace.setLevel(TraceSystem.DEBUG);
for (int i = 0; i < LOG_COUNT; i++) {
logRootPageIds[i] = 3 + i;
}
int todoShouldBeOneMoreStartWith0;
writeHeader();
initLogs();
openPageIndex();
getLog().openForWriting(0);
switchLogIfPossible();
getLog().flush();
......@@ -231,18 +231,6 @@ trace.setLevel(TraceSystem.DEBUG);
}
}
private void openPageIndex() throws SQLException {
ObjectArray cols = new ObjectArray();
cols.add(new Column("HEAD", Value.INT));
cols.add(new Column("TABLE", Value.INT));
cols.add(new Column("COLUMNS", Value.STRING));
int headPos = getSystemRootPageId();
pageTable = database.getMainSchema().createTable(
"PAGE_INDEX", 0, cols, true, false, headPos);
pageIndex = (PageScanIndex) pageTable.getScanIndex(
database.getSystemSession());
}
private void initLogs() {
for (int i = 0; i < LOG_COUNT; i++) {
logs[i] = new PageLog(this, logRootPageIds[i]);
......@@ -625,16 +613,6 @@ trace.setLevel(TraceSystem.DEBUG);
return database;
}
/**
* Run recovery.
*/
public void recover() throws SQLException {
recover(true);
openPageIndex();
recover(false);
checkpoint();
}
/**
* Run one recovery stage. There are two recovery stages: first (undo is
* true) only the undo steps are run (restoring the state before the last
......@@ -757,17 +735,34 @@ trace.setLevel(TraceSystem.DEBUG);
return state.isCommitted(logId, pos);
}
public int getMetaTableHeadPos() {
int test;
public void addMeta(PageScanIndex pageScanIndex, int id) {
// pageIndex.add(session, row)
}
public int getMetaTableHeadPos() throws SQLException {
int todo;
return 0;
}
// public int getMetaTableHeadPos() {
// SearchRow r = pageIndex.getTemplateSimpleRow(false);
//
// return pageIndex.find(database.getSystemSession(), first, last)
// // TODO Auto-generated method stub
// return 0;
// }
private void openPageIndex() throws SQLException {
ObjectArray cols = new ObjectArray();
cols.add(new Column("HEAD", Value.INT));
cols.add(new Column("TABLE", Value.INT));
cols.add(new Column("COLUMNS", Value.STRING));
int headPos = getSystemRootPageId();
pageTable = database.getMainSchema().createTable(
"PAGE_INDEX", 0, cols, true, false, headPos);
pageIndex = (PageScanIndex) pageTable.getScanIndex(
database.getSystemSession());
}
private void readMetaData() throws SQLException {
Cursor cursor = pageIndex.find(database.getSystemSession(), null, null);
while (cursor.next()) {
Row row = cursor.get();
int headPos = row.getValue(0).getInt();
}
}
}
......@@ -278,31 +278,19 @@ java org.h2.test.TestAll timer
System.setProperty("h2.maxMemoryRowsDistinct", "128");
System.setProperty("h2.check2", "true");
// failing tests: 11 (1st round)
// System.setProperty("h2.pageStore", "true");
/*
mark 1.1 as stable
documentation: rolling review at roadmap.html:146
documentation: rolling review; consistently use <code> or not.
test performance with log=2
use 127.0.0.1 if other addresses don't work
select for update in mvcc mode: only lock the selected records?
JCR: for each node type, create a table; one 'dynamic' table with parameter;
option to cache the results
create a short 4 pages documentation
Favicon per page
<link rel="icon" type="image/png" href="/path/image.png">
documentation: how can you improve performance (group of settings)
create a short 4 pages documentation
test performance with log=2
postgresql generate_series?
is in-memory scan index re-using ids?
don't store default values (store a special value)
btree: maybe split at the insertion point
split files (1 GB max size)
......@@ -311,20 +299,9 @@ and delay on each commit
multithreaded kernel
remove old TODO
online backup may not work for very large files
(document problem with jdk 1.4; document to use jar -xf)
test web site with firefox 3, internet explorer, opera, safari, google chrome
test with 1.0
documentation: how can you improve performance (group of settings)
document url parameter open_new
osgi: create a sample application, test, document
merge join test case
auto_reconnect
implemented:
- auto_server includes auto_reconnect
......@@ -349,7 +326,6 @@ Concurrent update in table test: another transaction has updated or
deleted the same row when exactly does it occur in other databases
(PostgreSQL, Oracle)?
Run benchmark with the newest versions of other databases.
documentation: use 'server mode' not 'remote mode'.
CREATE FUNCTION? Function interface
......@@ -365,10 +341,6 @@ Procedure
DeallocateProcedure DEALLOCATE [PLAN] <name>
ExecuteProcedure EXECUTE <name>[([p[,...])]
in help.csv, use complete examples for functions; add a test case
analyzer configuration option for the fulltext search
optimize where x not in (select):
SELECT c FROM color LEFT OUTER JOIN (SELECT c FROM TABLE(c
VARCHAR= ?)) p ON color.c = p.c WHERE p.c IS NULL;
......
db1 = H2, org.h2.Driver, jdbc:h2:data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa
#db2 = H2 (nio), org.h2.Driver, jdbc:h2:nio:data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa
#db3 = H2 (nioMapped), org.h2.Driver, jdbc:h2:nioMapped:data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa
#db2 = H2 (MVCC), org.h2.Driver, jdbc:h2:data/test_mvcc;MVCC=TRUE, sa, sa
#xdb2 = H2 (nio), org.h2.Driver, jdbc:h2:nio:data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa
#xdb3 = H2 (nioMapped), org.h2.Driver, jdbc:h2:nioMapped:data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa
#xdb2 = H2 (MVCC), org.h2.Driver, jdbc:h2:data/test_mvcc;MVCC=TRUE, sa, sa
#xdb2 = H2 (XTEA), org.h2.Driver, jdbc:h2:data/test_xtea;LOCK_TIMEOUT=10000;LOCK_MODE=3;CIPHER=XTEA, sa, sa 123
#xdb3 = H2 (AES), org.h2.Driver, jdbc:h2:data/test_aes;LOCK_TIMEOUT=10000;LOCK_MODE=3;CIPHER=AES, sa, sa 123
#xdb4 = H2, org.h2.Driver, jdbc:h2:data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3;write_mode_log=rws;write_delay=0, sa, sa
#xdb5 = H2_PG, org.postgresql.Driver, jdbc:postgresql://localhost:5435/h2test, sa, sa
db2 = HSQLDB, org.hsqldb.jdbcDriver, jdbc:hsqldb:data/test;hsqldb.default_table_type=cached;sql.enforce_size=true, sa
db3 = Derby, org.apache.derby.jdbc.EmbeddedDriver, jdbc:derby:data/derby;create=true, sa, sa
db3 = Derby, org.apacheT.derby.jdbc.EmbeddedDriver, jdbc:derby:data/derby;create=true, sa, sa
db4 = H2, org.h2.Driver, jdbc:h2:tcp://localhost/data/testServer;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa
db5 = HSQLDB, org.hsqldb.jdbcDriver, jdbc:hsqldb:hsql://localhost/xdb, sa
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论