[
https://issues.apache.org/jira/browse/CALCITE-7477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Budiu resolved CALCITE-7477.
----------------------------------
Fix Version/s: 1.42.0
Resolution: Fixed
Fixed in
[https://github.com/apache/calcite/commit/5be90f8cf5be23054805f36f01ff9a3fe474728d]
Thank you for the contribution [~jogrogan]
> Push schema pattern filter into sub-schema map lookup to avoid loading all
> schemas
> ----------------------------------------------------------------------------------
>
> Key: CALCITE-7477
> URL: https://issues.apache.org/jira/browse/CALCITE-7477
> Project: Calcite
> Issue Type: Improvement
> Reporter: Joseph Grogan
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.42.0
>
>
> Currently, CalciteMetaImpl loads all sub-schemas from
> rootSchema.getSubSchemaMap() and then filters them in-memory via a
> Predicate1<MetaSchema> (the namedMatcher). This is inefficient when the
> schema map is large or lazily-loaded, because every sub-schema must be
> materialized before the LIKE pattern can be applied.
> The proposed fix is to add an overloaded schemas(String catalog, LikePattern
> pattern) method that passes the LikePattern directly to
> root.subSchemas().getNames(pattern), allowing the schema source to filter at
> the map level rather than post-hoc. This would act in the same way as
> tables() does today.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)