public class RuntimeStatisticsParser
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
RuntimeStatisticsParser.Qualifier
Class which represents a qualifier used in a scan.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
distinctScan |
private boolean |
eliminatedDuplicates |
private boolean |
indexRowToBaseRow |
private boolean |
indexScan |
private int |
isolationLevel |
private boolean |
lastKeyIndexScan |
private java.util.HashSet<RuntimeStatisticsParser.Qualifier> |
qualifiers |
private boolean |
scrollInsensitive |
private java.lang.String[] |
startPosition |
private java.lang.String |
statistics |
private java.lang.String[] |
stopPosition |
private boolean |
tableScan |
Constructor and Description |
---|
RuntimeStatisticsParser(java.lang.String rts)
Create a RuntimeStatistics object to parse the text and extract
information.
|
Modifier and Type | Method and Description |
---|---|
void |
assertSequence(java.lang.String[] strings)
Assert that a sequence of string exists in the statistics.
|
boolean |
eliminatedDuplicates()
Return whether or not the query involved a sort that eliminated
duplicates
|
private java.util.HashSet<RuntimeStatisticsParser.Qualifier> |
findQualifiers()
Find all qualifiers in a query plan.
|
boolean |
findString(java.lang.String stringToFind,
int instances)
Search the RuntimeStatistics for a string.
|
int |
getIsolationLevel() |
java.lang.String[] |
getStartPosition()
Find the start position ; sometimes using a scan start / stop is
a way of doing qualifiers using an index
|
java.lang.String[] |
getStopPosition()
Find the stop position ; sometimes using a scan start / stop is
a way of doing qualifiers using an index
|
boolean |
hasEqualsQualifier()
Return whether or not the query used an equals scan qualifier.
|
boolean |
hasGreaterThanOrEqualQualifier()
Return whether or not the query used a >= scan qualifier.
|
boolean |
hasLessThanQualifier()
Return whether or not the query used a < scan qualifier.
|
boolean |
hasNoQualifiers()
Return whether there are no qualifiers (i.e. qualifiers: None)
|
boolean |
isScrollInsensitive() |
boolean |
rowsQualifiedEquals(int qualRows)
Return whether or not the query plan includes a line of the form
"Number of rows qualified=n"
where "n" is the received qualRows argument.
|
java.lang.String |
toString() |
boolean |
usedConstraintForIndexScan(java.lang.String tableName) |
boolean |
usedDistinctScan()
Return whether or not a Distinct Scan result set was used in the
query.
|
boolean |
usedDistinctScan(java.lang.String tableName) |
boolean |
usedExistsJoin()
Check if an exists join (or a not exists join) was used.
|
boolean |
usedExternalSort() |
boolean |
usedHashJoin() |
boolean |
usedIndexRowToBaseRow()
Return whether or not an index row to base row result set was used in
the query.
|
boolean |
usedIndexRowToBaseRow(java.lang.String tableName) |
boolean |
usedIndexScan()
Return whether or not an index scan result set was used in the query.
|
boolean |
usedIndexScan(java.lang.String tableName) |
boolean |
usedLastKeyIndexScan()
Return whether or not a last key index scan result set was used
in the query.
|
boolean |
usedNLLeftOuterJoin() |
boolean |
usedSpecificIndexForIndexScan(java.lang.String tableName,
java.lang.String indexName) |
boolean |
usedTableScan()
Return whether or not a Table Scan result set was used in the
query.
|
boolean |
usedTableScan(java.lang.String tableName) |
boolean |
whatSortingRequired()
Check if sorting node was added for the query.
|
private int isolationLevel
private boolean distinctScan
private boolean eliminatedDuplicates
private boolean tableScan
private final boolean indexScan
private final boolean indexRowToBaseRow
private final boolean lastKeyIndexScan
private java.lang.String statistics
private boolean scrollInsensitive
private final java.util.HashSet<RuntimeStatisticsParser.Qualifier> qualifiers
private java.lang.String[] startPosition
private java.lang.String[] stopPosition
public RuntimeStatisticsParser(java.lang.String rts)
rts
- Runtime Statistics stringprivate java.util.HashSet<RuntimeStatisticsParser.Qualifier> findQualifiers()
Qualifier
spublic int getIsolationLevel()
public boolean usedDistinctScan()
public boolean usedTableScan()
public boolean usedTableScan(java.lang.String tableName)
tableName
- public boolean usedSpecificIndexForIndexScan(java.lang.String tableName, java.lang.String indexName)
tableName
- indexName
- public boolean usedIndexScan(java.lang.String tableName)
tableName
- public boolean usedConstraintForIndexScan(java.lang.String tableName)
tableName
- public boolean usedIndexScan()
public boolean usedLastKeyIndexScan()
public boolean usedIndexRowToBaseRow()
public boolean usedIndexRowToBaseRow(java.lang.String tableName)
tableName
- public boolean usedDistinctScan(java.lang.String tableName)
tableName
- public boolean eliminatedDuplicates()
public boolean isScrollInsensitive()
public boolean hasGreaterThanOrEqualQualifier()
public boolean hasLessThanQualifier()
public boolean hasEqualsQualifier()
public boolean hasNoQualifiers()
public boolean rowsQualifiedEquals(int qualRows)
public boolean usedHashJoin()
public boolean usedNLLeftOuterJoin()
public boolean usedExistsJoin()
true
if the query used a (not) exists joinpublic boolean findString(java.lang.String stringToFind, int instances)
stringToFind
- the string to search forinstances
- the minimum number of occurrences of the stringinstances
timespublic boolean whatSortingRequired()
public boolean usedExternalSort()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String[] getStartPosition()
public java.lang.String[] getStopPosition()
public void assertSequence(java.lang.String[] strings)
/ The strings in the argument are each assumed to start a line. Leading underscores are converted to tab characters before comparing.
strings
- The sequence of string expected to be found.Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.