Skip to content

Commit

Permalink
enhance/appendVerticeExecutor
Browse files Browse the repository at this point in the history
fix

small delete

small fix
  • Loading branch information
czpmango committed Dec 8, 2022
1 parent 3762db7 commit 4655639
Show file tree
Hide file tree
Showing 2 changed files with 20 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
19 changes: 19 additions & 0 deletions src/graph/planner/plan/Query.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,25 @@ class GetVertices : public Explore {
return props_.get();
}

bool noNeedFetchProp() const {
if (props_.get() == nullptr) {
return true;
}
auto& vprops = *props_;
for (const auto& vprop : vprops) {
auto& props = vprop.get_props();
if (props.size() > 1) {
return false;
}
DCHECK_EQ(props.size(), 1);
auto& prop = props.front();
if (prop.compare("_tag")) {
return false;
}
}
return true;
}

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

0 comments on commit 4655639

Please sign in to comment.