Skip to content

Commit

Permalink
enhance/appendVerticeExecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
czpmango committed Dec 7, 2022
1 parent 3762db7 commit 0bc1dd9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph/executor/query/AppendVerticesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ StatusOr<DataSet> AppendVerticesExecutor::buildRequestDataSet(const AppendVertic
folly::Future<Status> AppendVerticesExecutor::appendVertices() {
SCOPED_TIMER(&execTime_);
auto *av = asNode<AppendVertices>(node());
if (FLAGS_optimize_appendvertices && av != nullptr && av->props() == nullptr) {
if (FLAGS_optimize_appendvertices && av != nullptr && av->noNeedFetchProp()) {
return handleNullProp(av);
}

Expand Down
13 changes: 13 additions & 0 deletions src/graph/planner/plan/Query.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,19 @@ class GetVertices : public Explore {
return props_.get();
}

bool noNeedFetchProp() const {
if (props_.get() == nullptr) {
return true;
}
auto& props = *props_;
for (const auto& prop : props) {
if (!prop.get_props().empty()) {
return false;
}
}
return true;
}

const std::vector<Expr>* exprs() const {
return exprs_.get();
}
Expand Down

0 comments on commit 0bc1dd9

Please sign in to comment.