Class GenericCostController
- java.lang.Object
-
- org.apache.derby.impl.store.access.conglomerate.GenericCostController
-
- All Implemented Interfaces:
- RowCountable, StoreCostController
- Direct Known Subclasses:
- HeapCostController
public abstract class GenericCostController extends java.lang.Object implements StoreCostController
A Generic class which implements the basic functionality needed for a cost controller.
-
-
Field Summary
-
Fields inherited from interface org.apache.derby.iapi.store.access.StoreCostController
BASE_CACHED_ROW_FETCH_COST, BASE_GROUPSCAN_ROW_COST, BASE_HASHSCAN_ROW_FETCH_COST, BASE_NONGROUPSCAN_ROW_FETCH_COST, BASE_ROW_PER_BYTECOST, BASE_UNCACHED_ROW_FETCH_COST, STORECOST_CLUSTERED, STORECOST_SCAN_NORMAL, STORECOST_SCAN_SET
-
-
Constructor Summary
Constructors Constructor and Description GenericCostController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcheckConsistency()Public Methods implementing ConglomerateController which just delegate to OpenConglomerate:voidclose()voiddebugConglomerate()longgetEstimatedRowCount()Get the total estimated number of rows in the container.doublegetFetchFromFullKeyCost(FormatableBitSet validColumns, int access_type)Return the cost of exact key lookup.java.util.PropertiesgetInternalTablePropertySet(java.util.Properties prop)OpenConglomerategetOpenConglom()SpaceInfogetSpaceInfo()voidgetTableProperties(java.util.Properties prop)voidinit(OpenConglomerate open_conglom)Public Methods of This class:booleanisKeyed()booleanisTableLocked()is the open btree table locked?RowLocationnewRowLocationTemplate()voidsetEstimatedRowCount(long count)Set the total estimated number of rows in the container.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.derby.iapi.store.access.StoreCostController
close, getFetchFromRowLocationCost, getScanCost, newRowLocationTemplate
-
Methods inherited from interface org.apache.derby.iapi.store.access.RowCountable
getEstimatedRowCount, setEstimatedRowCount
-
-
-
-
Method Detail
-
getFetchFromFullKeyCost
public double getFetchFromFullKeyCost(FormatableBitSet validColumns, int access_type) throws StandardException
Return the cost of exact key lookup.Return the estimated cost of calling ScanController.fetch() on the current conglomerate, with start and stop positions set such that an exact match is expected.
This call returns the cost of a fetchNext() performed on a scan which has been positioned with a start position which specifies exact match on all keys in the row.
Example:
In the case of a btree this call can be used to determine the cost of doing an exact probe into btree, giving all key columns. This cost can be used if the client knows it will be doing an exact key probe but does not have the key's at optimize time to use to make a call to getScanCost()
- Specified by:
getFetchFromFullKeyCostin interfaceStoreCostController- Parameters:
validColumns- A description of which columns to return from row on the page into "templateRow." templateRow, and validColumns work together to describe the row to be returned by the fetch - see RowUtil for description of how these three parameters work together to describe a fetched "row".access_type- Describe the type of access the query will be performing to the ScanController. STORECOST_CLUSTERED - The location of one scan is likely clustered "close" to the previous scan. For instance if the query plan were to used repeated "reopenScan()'s" to probe for the next key in an index, then this flag should be be specified. If this flag is not set then each scan will be costed independant of any other predicted scan access.- Returns:
- The cost of the fetch.
- Throws:
StandardException- Standard exception policy.- See Also:
RowUtil
-
init
public void init(OpenConglomerate open_conglom) throws StandardException
Public Methods of This class:- Throws:
StandardException
-
getOpenConglom
public OpenConglomerate getOpenConglom()
-
checkConsistency
public void checkConsistency() throws StandardExceptionPublic Methods implementing ConglomerateController which just delegate to OpenConglomerate:- Throws:
StandardException
-
debugConglomerate
public void debugConglomerate() throws StandardException- Throws:
StandardException
-
getTableProperties
public void getTableProperties(java.util.Properties prop) throws StandardException- Throws:
StandardException
-
getInternalTablePropertySet
public java.util.Properties getInternalTablePropertySet(java.util.Properties prop) throws StandardException- Throws:
StandardException
-
getSpaceInfo
public SpaceInfo getSpaceInfo() throws StandardException
- Throws:
StandardException
-
close
public void close() throws StandardException- Throws:
StandardException
-
isKeyed
public boolean isKeyed()
-
newRowLocationTemplate
public RowLocation newRowLocationTemplate() throws StandardException
- Throws:
StandardException
-
isTableLocked
public boolean isTableLocked()
is the open btree table locked?
-
getEstimatedRowCount
public long getEstimatedRowCount() throws StandardExceptionGet the total estimated number of rows in the container.The number is a rough estimate and may be grossly off. In general the server will cache the row count and then occasionally write the count unlogged to a backing store. If the system happens to shutdown before the store gets a chance to update the row count it may wander from reality.
This call is currently only supported on Heap conglomerates, it will throw an exception if called on btree conglomerates.
- Returns:
- The total estimated number of rows in the conglomerate.
- Throws:
StandardException- Standard exception policy.
-
setEstimatedRowCount
public void setEstimatedRowCount(long count) throws StandardExceptionSet the total estimated number of rows in the container.Often, after a scan, the client of RawStore has a much better estimate of the number of rows in the container than what store has. For instance if we implement some sort of update statistics command, or just after a create index a complete scan will have been done of the table. In this case this interface allows the client to set the estimated row count for the container, and store will use that number for all future references.
This call is currently only supported on Heap conglomerates, it will throw an exception if called on btree conglomerates.
- Parameters:
count- the estimated number of rows in the container.- Throws:
StandardException- Standard exception policy.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG