Interface RelationStatistics


public interface RelationStatistics
The statistics a DERIVED relation — a subquery, a CTE, a view — still carries of the one catalog table beneath it, so that a query over the relation is planned from them as a query over the table would be. The account inlines such a relation: SELECT SYSTEM$TYPEOF(COUNT(*)) FROM (SELECT * FROM t) is bounded by t's row count exactly as FROM t is.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    passesStoredColumn(int index)
    Whether the relation's column at index passes one of the table's stored columns through unchanged — the kind of column a COUNT is answered from.
    boolean
    Whether every row of the table reaches the relation — through a projection, and a WHERE the table's statistics prove true of every row.
    The table's row count.
  • Method Details

    • readsWithinStatistics

      boolean readsWithinStatistics()
      Whether every row of the table reaches the relation — through a projection, and a WHERE the table's statistics prove true of every row. Decided on first use.
      Returns:
      true when the relation reads within the table's statistics
    • sourceRowCount

      Long sourceRowCount()
      The table's row count.
      Returns:
      the count, or null when the table's rows are not reachable
    • passesStoredColumn

      boolean passesStoredColumn(int index)
      Whether the relation's column at index passes one of the table's stored columns through unchanged — the kind of column a COUNT is answered from.
      Parameters:
      index - the column's position in the relation
      Returns:
      true for a stored column passed through