public abstract class SearchPlan
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ALWAYS_LOAD_FIELD_CACHE_LIMIT
If the estimate rows is less than this value just load it anyway
|
static long |
DEFAULT_TIMEOUT
The default time out period for a query
|
protected int |
maxFullListInsteadOfAffirmativeRestriction
max full list
|
protected long |
maxFullRecordScan
max full scan
|
protected DBQuery |
query
the query
|
static java.lang.String |
RESOLUTION_KNOWN_TO_FAIL
This query will fail we should not try
|
static java.lang.String |
RESOLUTION_UNKOWN
The resolution is Unknown
|
Constructor and Description |
---|
SearchPlan(DBQuery query)
Creates a new Search plan
|
Modifier and Type | Method and Description |
---|---|
void |
addClauseUsed(DBPathClause bestClause)
add the clause that was used
|
abstract boolean |
archiveSearch(LayerSearchResult lsr)
do an archive search
|
boolean |
checkThirdPhase(PossibleRowsHolder rows)
check third phase
|
long |
checkTimeout()
Check the query timeout.
|
static DBClause |
cleanCriteria(DBQuery query,
DBClause clause)
clean a criteria
|
abstract void |
doLayerSearch(LayerSearchResult lsr) |
VirtualDB |
getBottomLayer()
The bottom most possible layer
|
DBCriteria |
getCriteria()
Short hand to the query's criteria
|
VirtualDB |
getDataBase()
The virtual database for this plan
|
long |
getEstimatedDatabaseRows()
The number of rows in the database for this class.
|
long |
getEstimatedMatchRows(DBCriteria criteria) |
long |
getEstimatedMatchRows(DBPathClause pc)
The estimated number of rows that will be returned by this clause.
|
DBPathClause |
getFirstClausedUsed()
what clause was used ?
|
int |
getMaxFullListInsteadOfAffirmativeRestriction()
The maximum size of the full table list that will be used for a in-memory
table scan instead of an affirmative restriction database search
|
long |
getMaxFullRecordScan()
the max full record to scan
|
int |
getMaximumRequiredRows()
get the maximum number of rows to fetch.
|
DBQuery |
getQuery()
The actual query for this plan
|
java.lang.String |
getResolution()
What was the resolution ?
|
DBPathClause |
getSecondClausedUsed()
The second clause was used ?
|
long |
getStartTime()
When did the query start ?
|
DBPathClause |
getThirdClausedUsed()
The third clause was used ?
|
VirtualDB |
getTopLayer()
The top most possible layer
|
boolean |
isLayerExcluded(int layerId)
Is the search excluded from this layer ?
|
void |
setForcePhaseThree(boolean flag)
force phase three
|
SearchPlan |
setMasterPlan(SearchPlan masterPlan)
Set the master plan
|
void |
setMaxFullListInsteadOfAffirmativeRestriction(int max)
set the maximum size of the full table list that will be used for a in-memory
table scan instead of an affirmative restriction database search
|
void |
setMaxFullRecordScan(long maxRows)
set max full record scan
|
void |
setMaximumRequiredRows(int rows)
set the maximum number of rows to fetch.
|
void |
setResolution(java.lang.String type)
How did we find the records ?
|
PossibleRowsHolder |
tryPlanCache()
CAN YOU HANDLE THIS QUERY ? If so return the possible rows here.
|
boolean |
useCache()
Should we use the cache for this query.
|
boolean |
willSearchFail()
Will this search fail ?
|
public static final int ALWAYS_LOAD_FIELD_CACHE_LIMIT
public static final java.lang.String RESOLUTION_UNKOWN
public static final java.lang.String RESOLUTION_KNOWN_TO_FAIL
public static final long DEFAULT_TIMEOUT
protected int maxFullListInsteadOfAffirmativeRestriction
protected final DBQuery query
protected long maxFullRecordScan
public SearchPlan(@Nonnull DBQuery query)
query
- The querypublic SearchPlan setMasterPlan(SearchPlan masterPlan)
masterPlan
- the master planpublic static DBClause cleanCriteria(DBQuery query, DBClause clause)
query
- the queryclause
- the clause to checkpublic abstract void doLayerSearch(LayerSearchResult lsr) throws java.lang.Exception
lsr
- the resultjava.lang.Exception
- a serious problempublic abstract boolean archiveSearch(LayerSearchResult lsr) throws java.lang.Exception
lsr
- the resultjava.lang.Exception
- a serious problem@CheckReturnValue public boolean useCache()
@CheckReturnValue public long getStartTime()
@CheckReturnValue @Nonnull public VirtualDB getBottomLayer()
public long checkTimeout() throws QueryTimeoutException
QueryTimeoutException
- The query has run longer than the maximum query time.@CheckReturnValue @Nullable public PossibleRowsHolder tryPlanCache() throws java.lang.Exception
java.lang.Exception
- A serious problempublic void setResolution(java.lang.String type)
type
- The resolution@CheckReturnValue public java.lang.String getResolution()
public void setMaximumRequiredRows(int rows)
rows
- the max rows.@CheckReturnValue public int getMaximumRequiredRows()
@CheckReturnValue public final DBQuery getQuery()
@CheckReturnValue public final DBCriteria getCriteria()
@CheckReturnValue public final VirtualDB getDataBase()
@CheckReturnValue public boolean willSearchFail()
@CheckReturnValue @Nonnull public VirtualDB getTopLayer()
@CheckReturnValue public boolean isLayerExcluded(int layerId)
layerId
- The layer Id@CheckReturnValue @Nullable public DBPathClause getFirstClausedUsed()
@CheckReturnValue @Nullable public DBPathClause getSecondClausedUsed()
@CheckReturnValue @Nullable public DBPathClause getThirdClausedUsed()
@CheckReturnValue @Nonnegative public long getMaxFullRecordScan()
public void setMaxFullRecordScan(long maxRows)
maxRows
- the max rowspublic void addClauseUsed(@Nullable DBPathClause bestClause)
bestClause
- the clause usedpublic void setForcePhaseThree(boolean flag)
flag
- true to turn on.@CheckReturnValue public boolean checkThirdPhase(@Nonnull PossibleRowsHolder rows)
rows
- the rows@CheckReturnValue @Nonnegative public long getEstimatedDatabaseRows()
@CheckReturnValue @Nonnegative public long getEstimatedMatchRows(@Nonnull DBPathClause pc)
pc
- The clause to estimate@CheckReturnValue @Nonnegative public long getEstimatedMatchRows(@Nonnull DBCriteria criteria)
@CheckReturnValue @Nonnegative public int getMaxFullListInsteadOfAffirmativeRestriction()
public void setMaxFullListInsteadOfAffirmativeRestriction(int max)
max
- the maximum rows.stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.