Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
miniob
提交
3653849b
M
miniob
项目概览
oceanbase
/
miniob
1 年多 前同步成功
通知
74
Star
1521
Fork
537
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
M
miniob
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
提交
3653849b
编写于
1月 26, 2023
作者:
L
Longda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix the wrong sequence between query_cache_stage and plan_cache_stage
上级
373f9f3c
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
17 addition
and
18 deletion
+17
-18
etc/observer.ini
etc/observer.ini
+4
-5
src/observer/session/session_stage.cpp
src/observer/session/session_stage.cpp
+3
-3
src/observer/session/session_stage.h
src/observer/session/session_stage.h
+1
-1
src/observer/sql/parser/resolve_stage.cpp
src/observer/sql/parser/resolve_stage.cpp
+2
-2
src/observer/sql/parser/resolve_stage.h
src/observer/sql/parser/resolve_stage.h
+1
-1
src/observer/sql/plan_cache/plan_cache_stage.cpp
src/observer/sql/plan_cache/plan_cache_stage.cpp
+2
-2
src/observer/sql/plan_cache/plan_cache_stage.h
src/observer/sql/plan_cache/plan_cache_stage.h
+1
-1
src/observer/sql/query_cache/query_cache_stage.cpp
src/observer/sql/query_cache/query_cache_stage.cpp
+2
-2
src/observer/sql/query_cache/query_cache_stage.h
src/observer/sql/query_cache/query_cache_stage.h
+1
-1
未找到文件。
etc/observer.ini
浏览文件 @
3653849b
...
@@ -57,11 +57,10 @@ count=3
...
@@ -57,11 +57,10 @@ count=3
[SessionStage]
[SessionStage]
ThreadId
=
SQLThreads
ThreadId
=
SQLThreads
NextStages
=
Plan
CacheStage
NextStages
=
Query
CacheStage
[
Plan
CacheStage]
[
Query
CacheStage]
ThreadId
=
SQLThreads
ThreadId
=
SQLThreads
#NextStages=OptimizeStage
NextStages
=
ParseStage
NextStages
=
ParseStage
[ParseStage]
[ParseStage]
...
@@ -70,9 +69,9 @@ NextStages=ResolveStage
...
@@ -70,9 +69,9 @@ NextStages=ResolveStage
[ResolveStage]
[ResolveStage]
ThreadId
=
SQLThreads
ThreadId
=
SQLThreads
NextStages
=
Query
CacheStage
NextStages
=
Plan
CacheStage
[
Query
CacheStage]
[
Plan
CacheStage]
ThreadId
=
SQLThreads
ThreadId
=
SQLThreads
NextStages
=
OptimizeStage
NextStages
=
OptimizeStage
...
...
src/observer/session/session_stage.cpp
浏览文件 @
3653849b
...
@@ -35,7 +35,7 @@ using namespace common;
...
@@ -35,7 +35,7 @@ using namespace common;
const
std
::
string
SessionStage
::
SQL_METRIC_TAG
=
"SessionStage.sql"
;
const
std
::
string
SessionStage
::
SQL_METRIC_TAG
=
"SessionStage.sql"
;
// Constructor
// Constructor
SessionStage
::
SessionStage
(
const
char
*
tag
)
:
Stage
(
tag
),
plan
_cache_stage_
(
nullptr
),
sql_metric_
(
nullptr
)
SessionStage
::
SessionStage
(
const
char
*
tag
)
:
Stage
(
tag
),
query
_cache_stage_
(
nullptr
),
sql_metric_
(
nullptr
)
{}
{}
// Destructor
// Destructor
...
@@ -74,7 +74,7 @@ bool SessionStage::initialize()
...
@@ -74,7 +74,7 @@ bool SessionStage::initialize()
LOG_TRACE
(
"Enter"
);
LOG_TRACE
(
"Enter"
);
std
::
list
<
Stage
*>::
iterator
stgp
=
next_stage_list_
.
begin
();
std
::
list
<
Stage
*>::
iterator
stgp
=
next_stage_list_
.
begin
();
plan
_cache_stage_
=
*
(
stgp
++
);
query
_cache_stage_
=
*
(
stgp
++
);
MetricsRegistry
&
metricsRegistry
=
get_metrics_registry
();
MetricsRegistry
&
metricsRegistry
=
get_metrics_registry
();
sql_metric_
=
new
SimpleTimer
();
sql_metric_
=
new
SimpleTimer
();
...
@@ -163,5 +163,5 @@ void SessionStage::handle_request(StageEvent *event)
...
@@ -163,5 +163,5 @@ void SessionStage::handle_request(StageEvent *event)
sev
->
push_callback
(
cb
);
sev
->
push_callback
(
cb
);
SQLStageEvent
*
sql_event
=
new
SQLStageEvent
(
sev
,
sql
);
SQLStageEvent
*
sql_event
=
new
SQLStageEvent
(
sev
,
sql
);
plan
_cache_stage_
->
handle_event
(
sql_event
);
query
_cache_stage_
->
handle_event
(
sql_event
);
}
}
src/observer/session/session_stage.h
浏览文件 @
3653849b
...
@@ -46,7 +46,7 @@ protected:
...
@@ -46,7 +46,7 @@ protected:
void
handle_request
(
common
::
StageEvent
*
event
);
void
handle_request
(
common
::
StageEvent
*
event
);
private:
private:
Stage
*
plan
_cache_stage_
=
nullptr
;
Stage
*
query
_cache_stage_
=
nullptr
;
common
::
SimpleTimer
*
sql_metric_
=
nullptr
;
common
::
SimpleTimer
*
sql_metric_
=
nullptr
;
static
const
std
::
string
SQL_METRIC_TAG
;
static
const
std
::
string
SQL_METRIC_TAG
;
};
};
...
...
src/observer/sql/parser/resolve_stage.cpp
浏览文件 @
3653849b
...
@@ -69,7 +69,7 @@ bool ResolveStage::initialize()
...
@@ -69,7 +69,7 @@ bool ResolveStage::initialize()
LOG_TRACE
(
"Enter"
);
LOG_TRACE
(
"Enter"
);
std
::
list
<
Stage
*>::
iterator
stgp
=
next_stage_list_
.
begin
();
std
::
list
<
Stage
*>::
iterator
stgp
=
next_stage_list_
.
begin
();
query
_cache_stage_
=
*
(
stgp
++
);
plan
_cache_stage_
=
*
(
stgp
++
);
LOG_TRACE
(
"Exit"
);
LOG_TRACE
(
"Exit"
);
return
true
;
return
true
;
...
@@ -114,7 +114,7 @@ void ResolveStage::handle_event(StageEvent *event)
...
@@ -114,7 +114,7 @@ void ResolveStage::handle_event(StageEvent *event)
sql_event
->
set_stmt
(
stmt
);
sql_event
->
set_stmt
(
stmt
);
query
_cache_stage_
->
handle_event
(
sql_event
);
plan
_cache_stage_
->
handle_event
(
sql_event
);
LOG_TRACE
(
"Exit
\n
"
);
LOG_TRACE
(
"Exit
\n
"
);
return
;
return
;
...
...
src/observer/sql/parser/resolve_stage.h
浏览文件 @
3653849b
...
@@ -34,7 +34,7 @@ protected:
...
@@ -34,7 +34,7 @@ protected:
protected:
protected:
private:
private:
Stage
*
query
_cache_stage_
=
nullptr
;
Stage
*
plan
_cache_stage_
=
nullptr
;
};
};
#endif //__OBSERVER_SQL_RESOLVE_STAGE_H__
#endif //__OBSERVER_SQL_RESOLVE_STAGE_H__
src/observer/sql/plan_cache/plan_cache_stage.cpp
浏览文件 @
3653849b
...
@@ -66,7 +66,7 @@ bool PlanCacheStage::initialize()
...
@@ -66,7 +66,7 @@ bool PlanCacheStage::initialize()
std
::
list
<
Stage
*>::
iterator
stgp
=
next_stage_list_
.
begin
();
std
::
list
<
Stage
*>::
iterator
stgp
=
next_stage_list_
.
begin
();
// execute_stage = *(stgp++);
// execute_stage = *(stgp++);
parse
_stage_
=
*
(
stgp
++
);
optimizer
_stage_
=
*
(
stgp
++
);
LOG_TRACE
(
"Exit"
);
LOG_TRACE
(
"Exit"
);
return
true
;
return
true
;
...
@@ -96,7 +96,7 @@ void PlanCacheStage::handle_event(StageEvent *event)
...
@@ -96,7 +96,7 @@ void PlanCacheStage::handle_event(StageEvent *event)
event->push_callback(cb);
event->push_callback(cb);
*/
*/
// do nothing here, pass the event to the next stage
// do nothing here, pass the event to the next stage
parse
_stage_
->
handle_event
(
event
);
optimizer
_stage_
->
handle_event
(
event
);
LOG_TRACE
(
"Exit
\n
"
);
LOG_TRACE
(
"Exit
\n
"
);
return
;
return
;
...
...
src/observer/sql/plan_cache/plan_cache_stage.h
浏览文件 @
3653849b
...
@@ -34,7 +34,7 @@ protected:
...
@@ -34,7 +34,7 @@ protected:
protected:
protected:
private:
private:
Stage
*
parse
_stage_
=
nullptr
;
Stage
*
optimizer
_stage_
=
nullptr
;
};
};
#endif //__OBSERVER_SQL_PLAN_CACHE_STAGE_H__
#endif //__OBSERVER_SQL_PLAN_CACHE_STAGE_H__
src/observer/sql/query_cache/query_cache_stage.cpp
浏览文件 @
3653849b
...
@@ -65,7 +65,7 @@ bool QueryCacheStage::initialize()
...
@@ -65,7 +65,7 @@ bool QueryCacheStage::initialize()
LOG_TRACE
(
"Enter"
);
LOG_TRACE
(
"Enter"
);
std
::
list
<
Stage
*>::
iterator
stgp
=
next_stage_list_
.
begin
();
std
::
list
<
Stage
*>::
iterator
stgp
=
next_stage_list_
.
begin
();
optimize
_stage_
=
*
(
stgp
++
);
parser
_stage_
=
*
(
stgp
++
);
LOG_TRACE
(
"Exit"
);
LOG_TRACE
(
"Exit"
);
return
true
;
return
true
;
...
@@ -83,7 +83,7 @@ void QueryCacheStage::handle_event(StageEvent *event)
...
@@ -83,7 +83,7 @@ void QueryCacheStage::handle_event(StageEvent *event)
{
{
LOG_TRACE
(
"Enter
\n
"
);
LOG_TRACE
(
"Enter
\n
"
);
optimize
_stage_
->
handle_event
(
event
);
parser
_stage_
->
handle_event
(
event
);
LOG_TRACE
(
"Exit
\n
"
);
LOG_TRACE
(
"Exit
\n
"
);
return
;
return
;
...
...
src/observer/sql/query_cache/query_cache_stage.h
浏览文件 @
3653849b
...
@@ -34,7 +34,7 @@ protected:
...
@@ -34,7 +34,7 @@ protected:
protected:
protected:
private:
private:
Stage
*
optimize
_stage_
=
nullptr
;
Stage
*
parser
_stage_
=
nullptr
;
};
};
#endif //__OBSERVER_SQL_QUERY_CACHE_STAGE_H__
#endif //__OBSERVER_SQL_QUERY_CACHE_STAGE_H__
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录