Skip to content

Commit

Permalink
[opt](mtmv) Add log when compute olap scan cost to locate problem eas…
Browse files Browse the repository at this point in the history
…ier (#45948)

### What problem does this PR solve?

Some mv test case should be chosen by cbo but not.
Add log when compute olap scan cost to locate problem easier
  • Loading branch information
seawinde authored Jan 2, 2025
1 parent 5fc52ba commit 3f9d833
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,12 @@ private Statistics computeOlapScan(OlapScan olapScan) {
// mv is selected, return its estimated stats
Optional<Statistics> optStats = cascadesContext.getStatementContext()
.getStatistics(((Relation) olapScan).getRelationId());
LOG.info("computeOlapScan optStats isPresent {}, tableRowCount is {}",
optStats.isPresent(), tableRowCount);
if (optStats.isPresent()) {
double selectedPartitionsRowCount = getSelectedPartitionRowCount(olapScan, tableRowCount);
LOG.info("computeOlapScan optStats is {}, selectedPartitionsRowCount is {}", optStats.get(),
selectedPartitionsRowCount);
// if estimated mv rowCount is more than actual row count, fall back to base table stats
if (selectedPartitionsRowCount >= optStats.get().getRowCount()) {
Statistics derivedStats = optStats.get();
Expand Down

0 comments on commit 3f9d833

Please sign in to comment.