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 Detail

      • 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.
      • updateOrDelete

        int updateOrDelete
      • bulkFetch

        int bulkFetch
      • targetTableUUIDString

        private java.lang.String targetTableUUIDString
      • validatingCheckConstraint

        private boolean validatingCheckConstraint
      • bulkFetchTurnedOff

        boolean bulkFetchTurnedOff
      • multiProbing

        boolean multiProbing
      • singleScanRowCount

        private double singleScanRowCount
      • columnNames

        private java.lang.String[] columnNames
      • specialMaxScan

        private boolean specialMaxScan
      • distinctScan

        private boolean distinctScan
      • raDependentScan

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

        private java.lang.String raParentResultSetId
      • fkIndexConglomId

        private long fkIndexConglomId
      • fkColArray

        private int[] fkColArray
      • baseTableRestrictionList

        PredicateList baseTableRestrictionList
        Restriction as a PredicateList
      • nonBaseTableRestrictionList

        PredicateList nonBaseTableRestrictionList
      • requalificationRestrictionList

        PredicateList requalificationRestrictionList
      • existsBaseTable

        private boolean existsBaseTable
      • isNotExists

        private boolean isNotExists
      • dependencyMap

        private JBitSet dependencyMap
      • getUpdateLocks

        private boolean getUpdateLocks
      • authorizeSYSUSERS

        private boolean authorizeSYSUSERS
      • rowLocationColumnName

        private java.lang.String rowLocationColumnName
      • gotRowCount

        private boolean gotRowCount
      • rowCount

        private long rowCount
    • Constructor Detail

      • FromBaseTable

        FromBaseTable​(TableName tableName,
                      java.lang.String correlationName,
                      ResultColumnList derivedRCL,
                      java.util.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,
                      java.lang.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