Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
210360228
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
210360228
Commits
55a2147b
Unverified
Commit
55a2147b
authored
4 years ago
by
Yee
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Response optimization time to client (#796)
parent
0f2f0d02
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/planner/ExecutionPlan.cpp
+1
-0
1 addition, 0 deletions
src/planner/ExecutionPlan.cpp
src/planner/ExecutionPlan.h
+5
-0
5 additions, 0 deletions
src/planner/ExecutionPlan.h
src/service/QueryInstance.cpp
+9
-4
9 additions, 4 deletions
src/service/QueryInstance.cpp
with
15 additions
and
4 deletions
src/planner/ExecutionPlan.cpp
+
1
−
0
View file @
55a2147b
...
...
@@ -86,6 +86,7 @@ static size_t makePlanNodeDesc(const PlanNode* node, PlanDescription* planDesc)
void
ExecutionPlan
::
fillPlanDescription
(
PlanDescription
*
planDesc
)
const
{
DCHECK
(
planDesc
!=
nullptr
);
planDesc
->
optimize_time_in_us
=
optimizeTimeInUs_
;
makePlanNodeDesc
(
root_
,
planDesc
);
}
...
...
This diff is collapsed.
Click to expand it.
src/planner/ExecutionPlan.h
+
5
−
0
View file @
55a2147b
...
...
@@ -34,9 +34,14 @@ public:
return
root_
;
}
int32_t
*
optimizeTimeInUs
()
{
return
&
optimizeTimeInUs_
;
}
void
fillPlanDescription
(
PlanDescription
*
planDesc
)
const
;
private
:
int32_t
optimizeTimeInUs_
{
0
};
int64_t
id_
{
-
1
};
PlanNode
*
root_
{
nullptr
};
};
...
...
This diff is collapsed.
Click to expand it.
src/service/QueryInstance.cpp
+
9
−
4
View file @
55a2147b
...
...
@@ -14,6 +14,7 @@
#include
"planner/ExecutionPlan.h"
#include
"planner/PlanNode.h"
#include
"scheduler/Scheduler.h"
#include
"util/ScopedTimer.h"
#include
"validator/Validator.h"
#include
"util/AstUtils.h"
#include
"stats/StatsDef.h"
...
...
@@ -67,10 +68,14 @@ Status QueryInstance::validateAndOptimize() {
NG_RETURN_IF_ERROR
(
Validator
::
validate
(
sentence_
.
get
(),
qctx
()));
auto
rootStatus
=
optimizer_
->
findBestPlan
(
qctx_
.
get
());
NG_RETURN_IF_ERROR
(
rootStatus
);
auto
newRoot
=
std
::
move
(
rootStatus
).
value
();
qctx_
->
setPlan
(
std
::
make_unique
<
ExecutionPlan
>
(
const_cast
<
PlanNode
*>
(
newRoot
)));
auto
plan
=
std
::
make_unique
<
ExecutionPlan
>
();
{
SCOPED_TIMER
(
plan
->
optimizeTimeInUs
());
auto
rootStatus
=
optimizer_
->
findBestPlan
(
qctx_
.
get
());
NG_RETURN_IF_ERROR
(
rootStatus
);
plan
->
setRoot
(
const_cast
<
PlanNode
*>
(
std
::
move
(
rootStatus
).
value
()));
}
qctx_
->
setPlan
(
std
::
move
(
plan
));
return
Status
::
OK
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment