Skip to content

Commit

Permalink
Fix projection profiler (#4908)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfengHKU authored Feb 15, 2025
1 parent cf860af commit 9e4cdc4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/processor/operator/projection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ bool Projection::getNextTuplesInternal(ExecutionContext* context) {
}
// The if statement is added to avoid the cost of calculating numTuples when metric is disabled.
if (metrics->numOutputTuple.enabled) [[unlikely]] {
metrics->numOutputTuple.increase(resultSet->getNumTuples(info.outputChunkPosSet));
if (info.outputChunkPosSet.empty()) {
// In COUNT(*) case we are projecting away everything and only track multiplicity
metrics->numOutputTuple.increase(resultSet->multiplicity);
} else {
metrics->numOutputTuple.increase(resultSet->getNumTuples(info.outputChunkPosSet));
}
}
return true;
}
Expand Down
2 changes: 2 additions & 0 deletions test/test_files/explain/explain.test
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@
-LOG ProfileQuery
-STATEMENT Profile MATCH (p:npytable) RETURN p.id
---- ok
-STATEMENT PROFILE MATCH (a:person)-[]->(b:person) RETURN COUNT(*)
---- ok

0 comments on commit 9e4cdc4

Please sign in to comment.