Class JdbcStatisticsProvider

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getColumnCardinality​(Dialect dialect, javax.sql.DataSource dataSource, java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String column, Execution execution)
      Returns an estimate of the number of rows in a table.
      int getQueryCardinality​(Dialect dialect, javax.sql.DataSource dataSource, java.lang.String sql, Execution execution)
      Returns an estimate of the number of rows returned by a query.
      int getTableCardinality​(Dialect dialect, javax.sql.DataSource dataSource, java.lang.String catalog, java.lang.String schema, java.lang.String table, Execution execution)
      Returns an estimate of the number of rows in a table.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JdbcStatisticsProvider

        public JdbcStatisticsProvider()
    • Method Detail

      • getTableCardinality

        public int getTableCardinality​(Dialect dialect,
                                       javax.sql.DataSource dataSource,
                                       java.lang.String catalog,
                                       java.lang.String schema,
                                       java.lang.String table,
                                       Execution execution)
        Description copied from interface: StatisticsProvider
        Returns an estimate of the number of rows in a table.
        Specified by:
        getTableCardinality in interface StatisticsProvider
        Parameters:
        dialect - Dialect
        dataSource - Data source
        catalog - Catalog name
        schema - Schema name
        table - Table name
        execution - Execution
        Returns:
        Estimated number of rows in table, or -1 if there is no estimate
      • getQueryCardinality

        public int getQueryCardinality​(Dialect dialect,
                                       javax.sql.DataSource dataSource,
                                       java.lang.String sql,
                                       Execution execution)
        Description copied from interface: StatisticsProvider
        Returns an estimate of the number of rows returned by a query.
        Specified by:
        getQueryCardinality in interface StatisticsProvider
        Parameters:
        dialect - Dialect
        dataSource - Data source
        sql - Query, e.g. "select * from customers where age < 20"
        execution - Execution
        Returns:
        Estimated number of rows returned by query, or -1 if there is no estimate
      • getColumnCardinality

        public int getColumnCardinality​(Dialect dialect,
                                        javax.sql.DataSource dataSource,
                                        java.lang.String catalog,
                                        java.lang.String schema,
                                        java.lang.String table,
                                        java.lang.String column,
                                        Execution execution)
        Description copied from interface: StatisticsProvider
        Returns an estimate of the number of rows in a table.
        Specified by:
        getColumnCardinality in interface StatisticsProvider
        Parameters:
        dialect - Dialect
        dataSource - Data source
        catalog - Catalog name
        schema - Schema name
        table - Table name
        column - Column name
        execution - Execution
        Returns:
        Estimated number of rows in table, or -1 if there is no estimate