[
https://issues.apache.org/jira/browse/CALCITE-6763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
xiaochen.zhou updated CALCITE-6763:
-----------------------------------
Description:
Our current logic using a PriorityQueue to select the tile with the fewest rows
when multiple tiles are available. However, there are several potential issues:
1. The PriorityQueue stores all satisfiable tiles. When the number of tiles is
large, maintaining the heap structure during element insertion has a time
complexity of O(log n), which also increases memory usage.
2. The initial size of the PriorityQueue is difficult to estimate and is
currently set to 1, causing frequent resizing of the PriorityQueue.
We can optimize the code by keeping only a single bestCandidate tile to improve
performance.
was:
Our current logic using a PriorityQueue to select the tile with the fewest
rows when multiple tiles are available. However, there are several potential
issues:
1. The PriorityQueue stores all satisfiable tiles. When the number of tiles is
large, maintaining the heap structure during element insertion has a time
complexity of O(log n), which also increases memory usage.
2. The initial size of the PriorityQueue is difficult to estimate and is
currently set to 1, causing frequent resizing of the PriorityQueue.
We can optimize the code by keeping only a single bestCandidate tile to improve
performance.
> Optimize logic to select the roll-up with the fewest rows
> ----------------------------------------------------------
>
> Key: CALCITE-6763
> URL: https://issues.apache.org/jira/browse/CALCITE-6763
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: xiaochen.zhou
> Priority: Major
> Labels: pull-request-available
>
> Our current logic using a PriorityQueue to select the tile with the fewest
> rows when multiple tiles are available. However, there are several potential
> issues:
> 1. The PriorityQueue stores all satisfiable tiles. When the number of tiles
> is large, maintaining the heap structure during element insertion has a time
> complexity of O(log n), which also increases memory usage.
> 2. The initial size of the PriorityQueue is difficult to estimate and is
> currently set to 1, causing frequent resizing of the PriorityQueue.
> We can optimize the code by keeping only a single bestCandidate tile to
> improve performance.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)