Package org.h2.table

Class RangeTable

All Implemented Interfaces:
HasSQL

public class RangeTable extends VirtualTable
The table SYSTEM_RANGE is a virtual table that generates incrementing numbers with a given start end point.
  • Field Details

  • Constructor Details

    • RangeTable

      public RangeTable(Schema schema, Expression min, Expression max)
      Create a new range with the given start and end expressions.
      Parameters:
      schema - the schema (always the main schema)
      min - the start expression
      max - the end expression
    • RangeTable

      public RangeTable(Schema schema, Expression min, Expression max, Expression step)
  • Method Details

    • getSQL

      public StringBuilder getSQL(StringBuilder builder, int sqlFlags)
      Description copied from interface: HasSQL
      Appends the SQL statement of this object to the specified builder.
      Specified by:
      getSQL in interface HasSQL
      Overrides:
      getSQL in class SchemaObject
      Parameters:
      builder - string builder
      sqlFlags - formatting flags
      Returns:
      the specified string builder
    • canGetRowCount

      public boolean canGetRowCount(SessionLocal session)
      Description copied from class: Table
      Check if the row count can be retrieved quickly.
      Specified by:
      canGetRowCount in class Table
      Parameters:
      session - the session
      Returns:
      true if it can
    • getRowCount

      public long getRowCount(SessionLocal session)
      Description copied from class: Table
      Get the row count for this table.
      Specified by:
      getRowCount in class Table
      Parameters:
      session - the session
      Returns:
      the row count
    • getTableType

      public TableType getTableType()
      Description copied from class: Table
      Get the table type name
      Overrides:
      getTableType in class VirtualTable
      Returns:
      the table type name
    • getScanIndex

      public Index getScanIndex(SessionLocal session)
      Description copied from class: Table
      Get the scan index to iterate through all rows.
      Specified by:
      getScanIndex in class Table
      Parameters:
      session - the session
      Returns:
      the index
    • getIndexes

      public ArrayList<Index> getIndexes()
      Description copied from class: Table
      Get all indexes for this table.
      Overrides:
      getIndexes in class VirtualTable
      Returns:
      the list of indexes
    • getMin

      public long getMin(SessionLocal session)
      Calculate and get the start value of this range.
      Parameters:
      session - the session
      Returns:
      the start value
    • getMax

      public long getMax(SessionLocal session)
      Calculate and get the end value of this range.
      Parameters:
      session - the session
      Returns:
      the end value
    • getStep

      public long getStep(SessionLocal session)
      Get the increment.
      Parameters:
      session - the session
      Returns:
      the increment (1 by default)
    • optimize

      private void optimize(SessionLocal s)
    • getMaxDataModificationId

      public long getMaxDataModificationId()
      Description copied from class: Table
      Get the last data modification id.
      Specified by:
      getMaxDataModificationId in class Table
      Returns:
      the modification id
    • getRowCountApproximation

      public long getRowCountApproximation(SessionLocal session)
      Description copied from class: Table
      Get the approximated row count for this table.
      Specified by:
      getRowCountApproximation in class Table
      Parameters:
      session - the session
      Returns:
      the approximated row count
    • isDeterministic

      public boolean isDeterministic()
      Description copied from class: Table
      Check if the table is deterministic.
      Specified by:
      isDeterministic in class Table
      Returns:
      true if it is