-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize go N steps over edge #1471
Conversation
Unit testing passed. |
Unit testing passed. |
Unit testing passed. |
Unit testing failed. |
Unit testing passed. |
Unit testing passed. |
1 similar comment
Unit testing passed. |
int64_t totalRows = 0; | ||
for (auto& resp : rpcResp.responses()) { | ||
if (resp.get_total_edges() != nullptr) { | ||
totalRows += *resp.get_total_edges(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe *(resp.get_total_edges()) more readable
src/graph/GoExecutor.cpp
Outdated
if (!edgeSchema.empty()) { | ||
auto it = edgeSchema.find(edgeType); | ||
DCHECK(it != edgeSchema.end()); | ||
reader = RowReader::getRowReader(edge.props, it->second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the reader depend edgeSchema, if the edgeSchema is empty, the reader is nullptr, then CHECK(reader != nullptr); will crash , so if can we return directly when edgeSchema is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If getAliasProp invoked, it means the reader should not be NULL. Otherwise it is a bug.
close #1604 |
@@ -1408,5 +1468,73 @@ SupportedType GoExecutor::getPropTypeFromInterim(const std::string &prop) const | |||
return index_->getColumnType(prop); | |||
} | |||
|
|||
nebula::cpp2::SupportedType GoExecutor::calculateExprType(Expression* exp) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the schema cache of graphd and the storaged are different, maybe has problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we use the schema in graphd.
And the problem also existed in current master branch, because different storaged maybe have different versions schema when updating it.
<< time::WallClock::fastNowInMicroSec() - start << "us"; | ||
} | ||
if (!ret.ok()) { | ||
LOG(ERROR) << "Get rows failed: " << ret.status(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add doError()
Optimize go executor. The pr improve the perf for "go 2 steps over edge" about 20x with about 1M vertex ids returned. Of course, it will improve the perf for other queries, but i have't test it yet. Main changes: 1. Modify the structure storaged returned, separate vertexId from props to avoid "getPropByName" called when getting dstId. (This is a normal request for go) 2. Return directly if current executor is the rightest. It avoid one extra encode/decode procedure which cost lots of time if we have many rows returned. 3. Pre calculate the yield columns types to avoid calculate them for every edge.
Optimize go executor.
The pr improve the perf for "go 2 steps over edge" about 20x with about 1M vertex ids returned.
Of course, it will improve the perf for other queries, but i have't test it yet.
Main changes:
Modify the structure storaged returned, separate vertexId from props to avoid "getPropByName" called when getting dstId. (This is a normal request for go)
Return directly if current executor is the rightest. It avoid one extra encode/decode procedure which cost lots of time if we have many rows returned.
Pre calculate the yield columns types to avoid calculate them for every edge.