Package mondrian.spi.impl
Class SqlStatisticsProvider
- java.lang.Object
-
- mondrian.spi.impl.SqlStatisticsProvider
-
- All Implemented Interfaces:
StatisticsProvider
public class SqlStatisticsProvider extends Object implements StatisticsProvider
Implementation ofStatisticsProvider
that generates SQL queries to count rows and distinct values.
-
-
Constructor Summary
Constructors Constructor Description SqlStatisticsProvider()
-
Method Summary
All Methods Instance Methods Concrete 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
public long getTableCardinality(Dialect dialect, DataSource dataSource, String catalog, String schema, String table, Execution execution)
Description copied from interface:StatisticsProvider
Returns an estimate of the number of rows in a table.- Specified by:
getTableCardinality
in 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:StatisticsProvider
Returns an estimate of the number of rows returned by a query.- Specified by:
getQueryCardinality
in 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:StatisticsProvider
Returns an estimate of the number of rows in a table.- Specified by:
getColumnCardinality
in 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
-
-