Package org.h2.index

Class VirtualConstructedTableIndex

  • All Implemented Interfaces:
    HasSQL

    public class VirtualConstructedTableIndex
    extends VirtualTableIndex
    An index for a virtual table that returns a result set. Search in this index performs scan over all rows and should be avoided.
    • Method Detail

      • isFindUsingFullTableScan

        public boolean isFindUsingFullTableScan()
        Description copied from class: Index
        Returns true if find() implementation performs scan over all index, false if find() performs the fast lookup.
        Overrides:
        isFindUsingFullTableScan in class Index
        Returns:
        true if find() implementation performs scan over all index, false if find() performs the fast lookup
      • find

        public Cursor find​(SessionLocal session,
                           SearchRow first,
                           SearchRow last)
        Description copied from class: Index
        Find a row or a list of rows and create a cursor to iterate over the result.
        Specified by:
        find in class Index
        Parameters:
        session - the session
        first - the first row, or null for no limit
        last - the last row, or null for no limit
        Returns:
        the cursor to iterate over the results
      • getCost

        public double getCost​(SessionLocal session,
                              int[] masks,
                              TableFilter[] filters,
                              int filter,
                              SortOrder sortOrder,
                              AllColumnsForPlan allColumnsSet)
        Description copied from class: Index
        Estimate the cost to search for rows given the search mask. There is one element per column in the search mask. For possible search masks, see IndexCondition.
        Specified by:
        getCost in class Index
        Parameters:
        session - the session
        masks - per-column comparison bit masks, null means 'always false', see constants in IndexCondition
        filters - all joined table filters
        filter - the current table filter index
        sortOrder - the sort order
        allColumnsSet - the set of all columns
        Returns:
        the estimated cost
      • getPlanSQL

        public java.lang.String getPlanSQL()
        Description copied from class: Index
        Get the message to show in a EXPLAIN statement.
        Overrides:
        getPlanSQL in class Index
        Returns:
        the plan
      • canScan

        public boolean canScan()
        Description copied from class: Index
        Can this index iterate over all rows?
        Overrides:
        canScan in class Index
        Returns:
        true if it can