public class IndexScanTest extends JDBCPerfTestCase
Modifier and Type | Field and Description |
---|---|
private java.sql.PreparedStatement |
preparedStmt
The prepared statement for the SQL expression that we want to test.
|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Modifier | Constructor and Description |
---|---|
private |
IndexScanTest(java.lang.String name,
int iterations,
int repeats)
Create an instance of the test.
|
Modifier and Type | Method and Description |
---|---|
void |
decimal10columns()
Test the performance of an index scan on a compound index on ten
DECIMAL(10,10) columns.
|
void |
decimal1column()
Test the performance of an index scan on a DECIMAL(10,10) column.
|
private static void |
fillWithRandomChars(java.util.Random r,
char[] chars)
Fill a
char array with random characters. |
private java.sql.PreparedStatement |
getOrPrepareStatement(java.lang.String sql)
Get the prepared statement that we use in the test.
|
static junit.framework.Test |
suite()
Create a test suite with all the test cases in this class.
|
protected void |
tearDown()
Do the necessary clean-up after running the test.
|
void |
varchar10()
Test the performance of an index scan on a VARCHAR(10) column.
|
void |
varchar100()
Test the performance of an index scan on a VARCHAR(100) column.
|
void |
varchar1000()
Test the performance of an index scan on a VARCHAR(1000) column.
|
void |
varcharAll()
Test the performance of an index scan with a compound index on
columns with type VARCHAR(10), VARCHAR(100) and VARCHAR(1000).
|
runBareOverridable, runTest
assertCallError, assertCheckTable, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbedded
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, setName, setUp, toString
private java.sql.PreparedStatement preparedStmt
private IndexScanTest(java.lang.String name, int iterations, int repeats)
name
- the name of the method to call in the testiterations
- the number of iteration in each test runrepeats
- the number of times each test run is repeatedprivate java.sql.PreparedStatement getOrPrepareStatement(java.lang.String sql) throws java.sql.SQLException
sql
- the SQL text to prepare if the statement isn't already
compiledjava.sql.SQLException
protected void tearDown() throws java.lang.Exception
tearDown
in class BaseJDBCTestCase
java.lang.Exception
public static junit.framework.Test suite()
private static void fillWithRandomChars(java.util.Random r, char[] chars)
char
array with random characters.r
- a random number generatorchars
- the array to fillpublic void varchar10() throws java.sql.SQLException
java.sql.SQLException
public void varchar100() throws java.sql.SQLException
java.sql.SQLException
public void varchar1000() throws java.sql.SQLException
java.sql.SQLException
public void varcharAll() throws java.sql.SQLException
java.sql.SQLException
public void decimal1column() throws java.sql.SQLException
java.sql.SQLException
public void decimal10columns() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.