Package mondrian.spi.impl
Class JdbcStatisticsProvider
java.lang.Object
mondrian.spi.impl.JdbcStatisticsProvider
- All Implemented Interfaces:
StatisticsProvider
Implementation of
StatisticsProvider that uses JDBC
metadata calls to count rows and distinct values.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetColumnCardinality(Dialect dialect, DataSource dataSource, String catalog, String schema, String table, String column, Execution execution) Returns an estimate of the number of rows in a table.longgetQueryCardinality(Dialect dialect, DataSource dataSource, String sql, Execution execution) Returns an estimate of the number of rows returned by a query.longgetTableCardinality(Dialect dialect, DataSource dataSource, String catalog, String schema, String table, Execution execution) Returns an estimate of the number of rows in a table.
-
Constructor Details
-
JdbcStatisticsProvider
public JdbcStatisticsProvider()
-
-
Method Details
-
getTableCardinality
public long getTableCardinality(Dialect dialect, DataSource dataSource, String catalog, String schema, String table, Execution execution) Description copied from interface:StatisticsProviderReturns an estimate of the number of rows in a table.- Specified by:
getTableCardinalityin interfaceStatisticsProvider- Parameters:
dialect- DialectdataSource- Data sourcecatalog- Catalog nameschema- Schema nametable- Table nameexecution- Execution- Returns:
- Estimated number of rows in table, or -1 if there is no estimate
-
getQueryCardinality
public long getQueryCardinality(Dialect dialect, DataSource dataSource, String sql, Execution execution) Description copied from interface:StatisticsProviderReturns an estimate of the number of rows returned by a query.- Specified by:
getQueryCardinalityin interfaceStatisticsProvider- Parameters:
dialect- DialectdataSource- Data sourcesql- 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 long getColumnCardinality(Dialect dialect, DataSource dataSource, String catalog, String schema, String table, String column, Execution execution) Description copied from interface:StatisticsProviderReturns an estimate of the number of rows in a table.- Specified by:
getColumnCardinalityin interfaceStatisticsProvider- Parameters:
dialect- DialectdataSource- Data sourcecatalog- Catalog nameschema- Schema nametable- Table namecolumn- Column nameexecution- Execution- Returns:
- Estimated number of rows in table, or -1 if there is no estimate
-