JdbcTableSource's CardinalityEstimator issues a "count(*)" statement which is both expensive and often unnecessary. Most dbms's keep some metadata tables/functions that immediately return an estimate for the cardinality of a table, since there's no real need for knowing the exact number of records.
For example in postgres you can do: "SELECT reltuples AS approximate_row_count FROM pg_class WHERE relname = 'table_name';"
JdbcTableSource's CardinalityEstimator issues a "count(*)" statement which is both expensive and often unnecessary. Most dbms's keep some metadata tables/functions that immediately return an estimate for the cardinality of a table, since there's no real need for knowing the exact number of records. For example in postgres you can do: "SELECT reltuples AS approximate_row_count FROM pg_class WHERE relname = 'table_name';"