Skip to content

Commit

Permalink
use maxPartitionRowCount as rowCount
Browse files Browse the repository at this point in the history
Signed-off-by: kaijian.ding <[email protected]>
  • Loading branch information
kaijianding committed Oct 16, 2024
1 parent ff72fdf commit 5402e74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,14 @@ public long getLastRefreshTime() {
return refreshScheme.getLastRefreshTime();
}

public long getMaxPartitionRowCount() {
long maxRowCount = 0;
for (Map.Entry<Long, Partition> entry : idToPartition.entrySet()) {
maxRowCount = Math.max(maxRowCount, entry.getValue().getBaseIndex().getRowCount());
}
return maxRowCount;
}

/**
* Check weather this materialized view's staleness is satisfied.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private static int orderingIntersectTables(MaterializationContext mvContext) {
* Prefer small table to large table
*/
private static long orderingRowCount(MaterializationContext mvContext) {
return mvContext.getMv().getRowCount();
return mvContext.getMv().getMaxPartitionRowCount();
}

@Override
Expand Down

0 comments on commit 5402e74

Please sign in to comment.