[
https://issues.apache.org/jira/browse/BEAM-7655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17547851#comment-17547851
]
Kenneth Knowles commented on BEAM-7655:
---------------------------------------
This issue has been migrated to https://github.com/apache/beam/issues/19562
> Multiple Instances of Beam Table During Query Planning
> ------------------------------------------------------
>
> Key: BEAM-7655
> URL: https://issues.apache.org/jira/browse/BEAM-7655
> Project: Beam
> Issue Type: Improvement
> Components: dsl-sql
> Reporter: Alireza Samadianzakaria
> Priority: P3
>
> When Calcite is planning the query it may ask the table provider for the same
> table multiple times and in different alternative query plans there might be
> different instances of the same table.
> Since the row count estimation is stored in the table instances, each time
> that the row count estimation is called for a new instance, the table creates
> a new estimate. The estimation may take some time; therefore, this can
> potentially downgrade the performance (of planning) and increase the planning
> time.
> There are two potential ways to solve this problem:
> 1- Make sure that the table providers do not create multiple instances for
> the same table.
> or
> 2- Keep the row count estimations in a common data structure or a static Map
> and reuse it in multiple instances when needed.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)