Package mondrian.spi
Interface StatisticsProvider
-
- All Known Implementing Classes:
JdbcStatisticsProvider
,SqlStatisticsProvider
public interface StatisticsProvider
Provides estimates of the number of rows in a database.Mondrian generally finds statistics providers via the
Dialect.getStatisticsProviders()
method on the dialect object for the current connection. The default implementation of that method looks first at the "mondrian.statistics.providers.DATABASE" property (substituting the current database name, e.g. MYSQL or ORACLE, for DATABASE), then at the"mondrian.statistics.providers"
property.- See Also:
JdbcStatisticsProvider
,SqlStatisticsProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getColumnCardinality(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.long
getQueryCardinality(Dialect dialect, DataSource dataSource, String sql, Execution execution)
Returns an estimate of the number of rows returned by a query.long
getTableCardinality(Dialect dialect, DataSource dataSource, String catalog, String schema, String table, Execution execution)
Returns an estimate of the number of rows in a table.
-
-
-
Method Detail
-
getTableCardinality
long getTableCardinality(Dialect dialect, DataSource dataSource, String catalog, String schema, String table, Execution execution)
Returns an estimate of the number of rows in a table.- 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
long getQueryCardinality(Dialect dialect, DataSource dataSource, String sql, Execution execution)
Returns an estimate of the number of rows returned by a query.- 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
long getColumnCardinality(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.- 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
-
-