提交 43bce1b4 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 074a4572
......@@ -900,8 +900,8 @@ SET AUTOCOMMIT OFF
"Commands (Other)","SET CACHE_SIZE","
SET CACHE_SIZE int
","
Sets the size of the cache in KB (each KB being 1024 bytes). The default value
is 16384 (16 MB). The value is rounded to the next higher power of two.
Sets the size of the cache in KB (each KB being 1024 bytes) for the current database.
The default value is 16384 (16 MB). The value is rounded to the next higher power of two.
Depending on the virtual machine, the actual memory required may be higher.
This setting is persistent and affects all connections as there is only one cache per database.
......
......@@ -18,7 +18,7 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>The user home directory prefix (~) is now only expanded when followed by a slash
<ul><li>The user home directory prefix (~) is now only expanded when followed by a slash
or backslash, or standing alone.
</li><li>Native fulltext search: before inserting or deleting data, FT_INIT() had to be called.
This is no longer required.
......
......@@ -26,6 +26,8 @@ Performance
Database Profiling</a><br />
<a href="#database_performance_tuning">
Database Performance Tuning</a><br />
<a href="#built_in_profiler">
Using the Built-In Profiler</a><br />
<a href="#fast_import">
Fast Database Import</a><br />
......@@ -543,6 +545,19 @@ INSERT INTO TEST
SORTED SELECT X, SPACE(100) FROM SYSTEM_RANGE(101, 200);
</pre>
<h2 id="built_in_profiler">Using the Built-In Profiler</h2>
<p>
A very simple Java profiler is built-in. To use it, use the following template:
</p>
<pre>
import org.h2.util.Profiler;
Profiler prof = new Profiler();
prof.startCollecting();
// .... some long running process, at least a few seconds
prof.stopCollecting();
System.out.println(prof.getTop(3));
</pre>
<h2 id="fast_import">Fast Database Import</h2>
<p>
To speed up large imports, consider using the following options temporarily:
......
......@@ -468,6 +468,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Automatic detection of redundant indexes.
</li><li>If the database URL ends with ";INIT=&lt;url&gt;" then the SQL script from the given file or URL is executed (the user name must have admin rights). Example URL: jdbc:h2:mem:test;INIT=~/init.sql
</li><li>Maybe reject join without "on" (except natural join).
</li><li>Cluster: support load balance with values for each server / auto detect.
</li></ul>
<h2>Not Planned</h2>
......
......@@ -120,7 +120,6 @@ public class CommandRemote implements CommandInterface {
prepareIfRequired();
Transfer transfer = transferList.get(i);
try {
// TODO cluster: support load balance with values for each server / auto detect
session.traceOperation("COMMAND_GET_META_DATA", id);
transfer.writeInt(SessionRemote.COMMAND_GET_META_DATA).writeInt(id).writeInt(objectId);
session.done(transfer);
......@@ -145,8 +144,6 @@ public class CommandRemote implements CommandInterface {
prepareIfRequired();
Transfer transfer = transferList.get(i);
try {
// TODO cluster: support load balance with values for each
// server / auto detect
session.traceOperation("COMMAND_EXECUTE_QUERY", id);
transfer.writeInt(SessionRemote.COMMAND_EXECUTE_QUERY).writeInt(id).writeInt(objectId).writeInt(
maxRows);
......
......@@ -1139,8 +1139,6 @@ public class Parser {
ifExists = readIfExists(ifExists);
command.setIfExists(ifExists);
return command;
// TODO role: support role names SELECT | DELETE | INSERT | UPDATE |
// ALL? does quoting work?
} else if (readIf("ALIAS")) {
boolean ifExists = readIfExists(false);
DropFunctionAlias command = new DropFunctionAlias(session);
......@@ -1666,7 +1664,6 @@ public class Parser {
}
private Expression readCondition() throws SQLException {
// TODO parser: should probably use switch case for performance
if (readIf("NOT")) {
return new ConditionNot(readCondition());
}
......
......@@ -103,7 +103,7 @@ public abstract class Prepared {
if (db == null) {
throw Message.getSQLException(ErrorCode.CONNECTION_BROKEN_1, "database closed");
}
// TODO parser: currently, compiling every create/drop/... twice!
// parser: currently, compiling every create/drop/... twice
// because needRecompile return true even for the first execution
return SysProperties.RECOMPILE_ALWAYS || prepareAlways || modificationMetaId < db.getModificationMetaId();
}
......
......@@ -289,7 +289,7 @@ public class SysProperties {
* In version 1.1, it is enabled by default.
* </p>
*/
// TODO: when removing this property, also remove
// when removing this property, also remove
// DataHandler.allocateObjectId, createTempFile it
public static final boolean LOB_FILES_IN_DIRECTORIES = getBooleanSetting("h2.lobFilesInDirectories", Constants.VERSION > 1.0);
......
......@@ -78,7 +78,6 @@ public class ConnectionInfo implements Cloneable {
ArrayList<String> list = SetTypes.getTypes();
HashSet<String> set = KNOWN_SETTINGS;
set.addAll(list);
// TODO document these settings
String[] connectionTime = new String[] { "ACCESS_MODE_LOG", "ACCESS_MODE_DATA", "AUTOCOMMIT", "CIPHER",
"CREATE", "CACHE_TYPE", "DB_CLOSE_ON_EXIT", "FILE_LOCK", "IGNORE_UNKNOWN_SETTINGS", "IFEXISTS",
"PASSWORD", "RECOVER", "USER", "DATABASE_EVENT_LISTENER_OBJECT", "AUTO_SERVER",
......
......@@ -111,7 +111,6 @@ public class Right extends DbObjectBase {
} else {
buff.append(getRights()).append(" ON ").append(table.getSQL());
}
// TODO rights: need role 'PUBLIC'
buff.append(" TO ").append(grantee.getSQL());
return buff.toString();
}
......
......@@ -150,7 +150,6 @@ public class CompareLike extends Condition {
// (at prepare time)
// otherwise we would need to prepare at execute time,
// which is maybe slower (but maybe not in this case!)
// TODO optimizer: like: check what other databases do
if (!right.isValueSet()) {
return;
}
......
......@@ -325,7 +325,6 @@ public class Comparison extends Condition {
public void createIndexConditions(Session session, TableFilter filter) {
if (right == null) {
// TODO index usage: IS [NOT] NULL index usage is possible
return;
}
ExpressionColumn l = null;
......
......@@ -124,10 +124,8 @@ public class ConditionAndOr extends Condition {
}
public Expression optimize(Session session) throws SQLException {
// TODO NULL: see wikipedia,
// NULL handling: see wikipedia,
// http://www-cs-students.stanford.edu/~wlam/compsci/sqlnulls
// TODO test all optimizations switched off against all on
// (including performance)
left = left.optimize(session);
right = right.optimize(session);
int lc = left.getCost(), rc = right.getCost();
......
......@@ -483,8 +483,6 @@ public class Function extends Expression implements FunctionCall {
if (v0 != null) {
session.getRandom().setSeed(v0.getInt());
}
// TODO function rand: if seed value is set,
// return a random value? probably yes
result = ValueDouble.get(session.getRandom().nextDouble());
break;
}
......@@ -569,7 +567,6 @@ public class Function extends Expression implements FunctionCall {
result = ValueString.get(getSoundex(v0.getString()));
break;
case SPACE: {
// TODO DOS attacks: limit len?
int len = Math.max(0, v0.getInt());
char[] chars = new char[len];
for (int i = len - 1; i >= 0; i--) {
......
org.h2.tools.Backup=Creates a backup of a database.\nThe database must be closed before using this tool,\n except when running in quiet mode.
org.h2.tools.Backup=Creates a backup of a database.\nThis tool copies all database files. The database must be closed before using\n this tool. To create a backup while the database is in use, run the BACKUP\n SQL statement. In an emergency, for example if the application is not\n responding, creating a backup using the Backup tool is possible by using the\n quiet mode. However, if the database is changed while the backup is running\n in quiet mode, the backup could be corrupt.
org.h2.tools.Backup.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-file <filename>] The target file name (default\: backup.zip)\n[-dir <dir>] The source directory (default\: .)\n[-db <database>] Source database; not required if there is only one\n[-quiet] Do not print progress information
org.h2.tools.ChangeFileEncryption=Allows changing the database file encryption password or algorithm.\nThis tool can not be used to change a password of a user.\n The database must be closed before using this tool.
org.h2.tools.ChangeFileEncryption.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-cipher type] The encryption type (AES or XTEA)\n[-dir <dir>] The database directory (default\: .)\n[-db <database>] Database name (all databases if not set)\n[-decrypt <pwd>] The decryption password (if not set\: not yet encrypted)\n[-encrypt <pwd>] The encryption password (if not set\: do not encrypt)\n[-quiet] Do not print progress information
......
......@@ -61,7 +61,8 @@ public class FileSystemDisk extends FileSystem {
}
/**
* Expand '~' to the user home directory. It is only be expanded if the ~ stands alone, or is followed by / or \.
* Expand '~' to the user home directory. It is only be expanded if the ~
* stands alone, or is followed by / or \.
*
* @param fileName the file name
* @return the native file name
......
......@@ -198,3 +198,28 @@ EXPLAIN SELECT VALUE FROM TEST ORDER BY VALUE DESC LIMIT 10;
;
DROP TABLE TEST;
-------------------------------------------------------------------------------
-- Optimize IN(..)
-------------------------------------------------------------------------------
-- This code snippet shows how IN(...) uses an index (unlike .. OR ..).
-- Initialize the data
CREATE TABLE TEST(ID INT PRIMARY KEY);
INSERT INTO TEST SELECT X FROM SYSTEM_RANGE(1, 1000);
-- Query the count
SELECT * FROM TEST WHERE ID IN(1, 1000);
--> 1
--> 1000
;
-- Display the query plan
EXPLAIN SELECT * FROM TEST WHERE ID IN(1, 1000);
--> SELECT TEST.ID
--> FROM PUBLIC.TEST /* PUBLIC.PRIMARY_KEY_2: ID IN(1, 1000) */
--> WHERE ID IN(1, 1000)
;
DROP TABLE TEST;
......@@ -298,6 +298,8 @@ java org.h2.test.TestAll timer
/*
AlterTableAlterColumn todo
outer join bug
// System.setProperty("h2.pageSize", "64");
......@@ -308,9 +310,6 @@ google app engine
documentation: rolling review at jaqu.html
optimization for X IN(..) and OR:
document in optimizations.sql
-------------
remove old TODO, move to roadmap
......
......@@ -47,9 +47,7 @@ Please provide any additional information below.
-----------------
ClassCastException
There is a known problem in version 1.2.120 that can cause a ClassCastException. Did you use version 1.2.120 with this database? If not, I have a few more questions:
This looks like a serious problem. I have a few questions:
- Could you send the full stack trace of the exception including message text?
- What is your database URL?
......@@ -64,11 +62,15 @@ There is a known problem in version 1.2.120 that can cause a ClassCastException.
- Did the application run out of memory (once, or multiple times)?
- Do you use any settings or special features (for example, the setting
LOG=0, or two phase commit, linked tables, cache settings)?
- Do you use any H2-specific system properties?
- Is the application multi-threaded?
- What operating system, file system, and virtual machine
(java -version) do you use?
- How did you start the Java process (java -Xmx... and so on)?
- To you use temporary tables?
- Is it (or was it at some point) a networked file system?
- How big is the database (file sizes)?
- How much heap memory does the Java process have?
- Is the database usually closed normally, or is process terminated
forcefully or the computer switched off?
- Is it possible to reproduce this problem using a fresh database
......
......@@ -491,10 +491,10 @@ public class TestFileLockSerialized extends TestBase {
}
deleteDb("fileLockSerialized");
}
private void testLeftLogFiles() throws Exception {
deleteDb("fileLockSerialized");
// without serialized
String url;
if (config.pageStore) {
......@@ -509,7 +509,7 @@ public class TestFileLockSerialized extends TestBase {
conn.close();
List<String> filesWithoutSerialized = Arrays.asList(new File(baseDir).list());
deleteDb("fileLockSerialized");
// with serialized
if (config.pageStore) {
url = "jdbc:h2:" + baseDir + "/fileLockSerialized;FILE_LOCK=SERIALIZED;PAGE_STORE=TRUE";
......@@ -522,7 +522,7 @@ public class TestFileLockSerialized extends TestBase {
Thread.sleep(500);
stat.execute("insert into test values(0)");
conn.close();
List<String> filesWithSerialized = Arrays.asList(new File(baseDir).list());
if (filesWithoutSerialized.size() != filesWithSerialized.size()) {
for (int i = 0; i < filesWithoutSerialized.size(); i++) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论