public class JdbcStatisticsProvider extends Object implements StatisticsProvider
StatisticsProvider
that uses JDBC
metadata calls to count rows and distinct values.Constructor and Description |
---|
JdbcStatisticsProvider() |
Modifier and Type | Method and 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.
|
public long getTableCardinality(Dialect dialect, DataSource dataSource, String catalog, String schema, String table, Execution execution)
StatisticsProvider
getTableCardinality
in interface StatisticsProvider
dialect
- DialectdataSource
- Data sourcecatalog
- Catalog nameschema
- Schema nametable
- Table nameexecution
- Executionpublic long getQueryCardinality(Dialect dialect, DataSource dataSource, String sql, Execution execution)
StatisticsProvider
getQueryCardinality
in interface StatisticsProvider
dialect
- DialectdataSource
- Data sourcesql
- Query, e.g. "select * from customers where age < 20"execution
- Executionpublic long getColumnCardinality(Dialect dialect, DataSource dataSource, String catalog, String schema, String table, String column, Execution execution)
StatisticsProvider
getColumnCardinality
in interface StatisticsProvider
dialect
- DialectdataSource
- Data sourcecatalog
- Catalog nameschema
- Schema nametable
- Table namecolumn
- Column nameexecution
- ExecutionCopyright © 2020 Hitachi Vantara. All rights reserved.