Class FromBaseTable

All Implemented Interfaces:
Optimizable, Visitable

class FromBaseTable extends FromTable
A FromBaseTable represents a table in the FROM list of a DML statement, as distinguished from a FromSubquery, which represents a subquery in the FROM list. A FromBaseTable may actually represent a view. During parsing, we can't distinguish views from base tables. During binding, when we find FromBaseTables that represent views, we replace them with FromSubqueries. By the time we get to code generation, all FromSubqueries have been eliminated, and all FromBaseTables will represent only true base tables.

Positioned Update: Currently, all columns of an updatable cursor are selected to deal with a positioned update. This is because we don't know what columns will ultimately be needed from the UpdateNode above us. For example, consider:



        get c as 'select cint from t for update of ctinyint'
  update t set ctinyint = csmallint

 
Ideally, the cursor only selects cint. Then, something akin to an IndexRowToBaseRow is generated to take the CursorResultSet and get the appropriate columns out of the base table from the RowLocation returned by the cursor. Then the update node can generate the appropriate NormalizeResultSet (or whatever else it might need) to get things into the correct format for the UpdateResultSet. See CurrentOfNode for more information.
  • Field Details

    • UNSET

      static final int UNSET
      See Also:
    • hasCheckedIndexStats

      private boolean hasCheckedIndexStats
      Whether or not we have checked the index statistics for staleness. Used to avoid performing the check multiple times per compilation.
    • tableName

      TableName tableName
    • tableDescriptor

      TableDescriptor tableDescriptor
    • baseConglomerateDescriptor

      ConglomerateDescriptor baseConglomerateDescriptor
    • conglomDescs

      ConglomerateDescriptor[] conglomDescs
    • updateOrDelete

      int updateOrDelete
    • bulkFetch

      int bulkFetch
    • targetTableUUIDString

      private String targetTableUUIDString
    • validatingCheckConstraint

      private boolean validatingCheckConstraint
    • bulkFetchTurnedOff

      boolean bulkFetchTurnedOff
    • multiProbing

      boolean multiProbing
    • singleScanRowCount

      private double singleScanRowCount
    • referencedCols

      private FormatableBitSet referencedCols
    • templateColumns

      private ResultColumnList templateColumns
    • columnNames

      private String[] columnNames
    • specialMaxScan

      private boolean specialMaxScan
    • distinctScan

      private boolean distinctScan
    • raDependentScan

      private boolean raDependentScan
      Information for dependent table scan for Referential Actions
    • raParentResultSetId

      private String raParentResultSetId
    • fkIndexConglomId

      private long fkIndexConglomId
    • fkColArray

      private int[] fkColArray
    • baseTableRestrictionList

      PredicateList baseTableRestrictionList
      Restriction as a PredicateList
    • nonBaseTableRestrictionList

      PredicateList nonBaseTableRestrictionList
    • restrictionList

      PredicateList restrictionList
    • storeRestrictionList

      PredicateList storeRestrictionList
    • nonStoreRestrictionList

      PredicateList nonStoreRestrictionList
    • requalificationRestrictionList

      PredicateList requalificationRestrictionList
    • UPDATE

      static final int UPDATE
      See Also:
    • DELETE

      static final int DELETE
      See Also:
    • existsBaseTable

      private boolean existsBaseTable
    • isNotExists

      private boolean isNotExists
    • dependencyMap

      private JBitSet dependencyMap
    • getUpdateLocks

      private boolean getUpdateLocks
    • authorizeSYSUSERS

      private boolean authorizeSYSUSERS
    • rowLocationColumnName

      private String rowLocationColumnName
    • gotRowCount

      private boolean gotRowCount
    • rowCount

      private long rowCount
  • Constructor Details

    • FromBaseTable

      FromBaseTable(TableName tableName, String correlationName, ResultColumnList derivedRCL, Properties tableProperties, ContextManager cm)
      Constructor for a table in a FROM list. Parameters are as follows:
      Parameters:
      tableName - The name of the table
      correlationName - The correlation name
      derivedRCL - The derived column list
      tableProperties - The Properties list associated with the table.
      cm - The context manager
    • FromBaseTable

      FromBaseTable(TableName tableName, String correlationName, int updateOrDelete, ResultColumnList derivedRCL, ContextManager cm)
      Initializer for a table in a FROM list. Parameters are as follows:
      Parameters:
      tableName - The name of the table
      correlationName - The correlation name
      updateOrDelete - Table is being updated/deleted from.
      derivedRCL - The derived column list
      cm - The context manager
  • Method Details