You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2017/06/09 21:07:18 UTC
[jira] [Resolved] (CALCITE-1812) Provide RelMetadataQuery from
planner to rules and invalidate in transformTo
[ https://issues.apache.org/jira/browse/CALCITE-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Hyde resolved CALCITE-1812.
----------------------------------
Resolution: Fixed
Fix Version/s: 1.13.0
Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/56d5261a. Thanks for the PR, [~rusanu]!
I moved the cached RelMetadataQuery from RelOptPlanner to RelOptCluster, so that it doesn't clash with lifecycle changes coming in CALCITE-1536.
> Provide RelMetadataQuery from planner to rules and invalidate in transformTo
> ----------------------------------------------------------------------------
>
> Key: CALCITE-1812
> URL: https://issues.apache.org/jira/browse/CALCITE-1812
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Remus Rusanu
> Assignee: Remus Rusanu
> Labels: performance
> Fix For: 1.13.0
>
>
> Currently rules create a needed {{RelMetadataQuery}} when matched (ie. {{RuleXxx.onMatch}}. Since rules are called often, on complex query this triggers a multiplication RMQ instances used. But each new instance carries a heavy price on performance, because is the RMQ instance that hosts the cache used to memoize various metadata lookups (like getEstimatedRows, getPulledUpPredicates, uniqueness and so on). From HIVE-16757 investigation, the performance impact can be 10x.
> The proposal is to have a RelMetadataQuery in the planner and pass it to the rules as a RelOptRuleCall property. Rules {{onMatch}} can make use of this instance. The rule call {{transformTo}} can handle invalidating the RMQ instance.
> If code knowingly invalidates metadata properties associated with a node by means other than transformTo, it should somehow invalidate the current RMQ.
> The RMQ invalidation can be made smarter, but my plan right now is to do the dumb thing and just toss it away. Will revisit this later, depending on measured impact.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)