Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d04354a8
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d04354a8
编写于
11月 11, 2019
作者:
L
lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TBASE-816]
上级
d3941fe9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
56 addition
and
24 deletion
+56
-24
src/client/src/tscFunctionImpl.c
src/client/src/tscFunctionImpl.c
+53
-22
src/client/src/tscProfile.c
src/client/src/tscProfile.c
+1
-1
src/system/detail/src/vnodeRead.c
src/system/detail/src/vnodeRead.c
+2
-1
未找到文件。
src/client/src/tscFunctionImpl.c
浏览文件 @
d04354a8
...
...
@@ -3786,10 +3786,11 @@ static void getStatics_i64(int64_t *primaryKey, int64_t *data, int32_t numOfRow,
static
void
getStatics_f
(
int64_t
*
primaryKey
,
float
*
data
,
int32_t
numOfRow
,
double
*
min
,
double
*
max
,
double
*
sum
,
int16_t
*
minIndex
,
int16_t
*
maxIndex
,
int32_t
*
numOfNull
)
{
*
min
=
DBL_MAX
;
*
max
=
-
DBL_MAX
;
*
minIndex
=
0
;
*
maxIndex
=
0
;
float
fmin
=
DBL_MAX
;
float
fmax
=
-
DBL_MAX
;
float
fminIndex
=
0
;
float
fmaxIndex
=
0
;
double
dsum
=
0
;
assert
(
numOfRow
<=
INT16_MAX
);
...
...
@@ -3799,15 +3800,19 @@ static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, dou
continue
;
}
*
sum
+=
data
[
i
];
if
(
*
min
>
data
[
i
])
{
*
min
=
data
[
i
];
*
minIndex
=
i
;
float
fv
=
0
;
*
(
int32_t
*
)(
&
fv
)
=
*
(
int32_t
*
)(
&
(
data
[
i
]));
//*sum += data[i];
dsum
+=
fv
;
if
(
fmin
>
fv
)
{
fmin
=
fv
;
fminIndex
=
i
;
}
if
(
*
max
<
data
[
i
]
)
{
*
max
=
data
[
i
]
;
*
maxIndex
=
i
;
if
(
fmax
<
fv
)
{
fmax
=
fv
;
f
maxIndex
=
i
;
}
// if (isNull(&lastVal, TSDB_DATA_TYPE_FLOAT)) {
...
...
@@ -3819,14 +3824,26 @@ static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, dou
// lastVal = data[i];
// }
}
double
csum
=
0
;
*
(
int64_t
*
)(
&
csum
)
=
*
(
int64_t
*
)
sum
;
csum
+=
dsum
;
*
(
int64_t
*
)(
sum
)
=
*
(
int64_t
*
)(
&
csum
);
*
(
int32_t
*
)
max
=
*
(
int32_t
*
)(
&
fmax
);
*
(
int32_t
*
)
min
=
*
(
int32_t
*
)(
&
fmin
);
*
(
int32_t
*
)
minIndex
=
*
(
int32_t
*
)(
&
fminIndex
);
*
(
int32_t
*
)
maxIndex
=
*
(
int32_t
*
)(
&
fmaxIndex
);
}
static
void
getStatics_d
(
int64_t
*
primaryKey
,
double
*
data
,
int32_t
numOfRow
,
double
*
min
,
double
*
max
,
double
*
sum
,
int16_t
*
minIndex
,
int16_t
*
maxIndex
,
int32_t
*
numOfNull
)
{
*
min
=
DBL_MAX
;
*
max
=
-
DBL_MAX
;
*
minIndex
=
0
;
*
maxIndex
=
0
;
double
dmin
=
DBL_MAX
;
double
dmax
=
-
DBL_MAX
;
double
dminIndex
=
0
;
double
dmaxIndex
=
0
;
double
dsum
=
0
;
assert
(
numOfRow
<=
INT16_MAX
);
...
...
@@ -3839,15 +3856,19 @@ static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, do
continue
;
}
*
sum
+=
data
[
i
];
if
(
*
min
>
data
[
i
])
{
*
min
=
data
[
i
];
*
minIndex
=
i
;
double
dv
=
0
;
*
(
int64_t
*
)(
&
dv
)
=
*
(
int64_t
*
)(
&
(
data
[
i
]));
//*sum += data[i];
dsum
+=
dv
;
if
(
dmin
>
dv
)
{
dmin
=
dv
;
dminIndex
=
i
;
}
if
(
*
max
<
data
[
i
]
)
{
*
max
=
data
[
i
]
;
*
maxIndex
=
i
;
if
(
dmax
<
dv
)
{
dmax
=
dv
;
d
maxIndex
=
i
;
}
// if (isNull(&lastVal, TSDB_DATA_TYPE_DOUBLE)) {
...
...
@@ -3859,6 +3880,16 @@ static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, do
// lastVal = data[i];
// }
}
double
csum
=
0
;
*
(
int64_t
*
)(
&
csum
)
=
*
(
int64_t
*
)
sum
;
csum
+=
dsum
;
*
(
int64_t
*
)(
sum
)
=
*
(
int64_t
*
)(
&
csum
);
*
(
int64_t
*
)
max
=
*
(
int64_t
*
)(
&
dmax
);
*
(
int64_t
*
)
min
=
*
(
int64_t
*
)(
&
dmin
);
*
(
int64_t
*
)
minIndex
=
*
(
int64_t
*
)(
&
dminIndex
);
*
(
int64_t
*
)
maxIndex
=
*
(
int64_t
*
)(
&
dmaxIndex
);
}
void
getStatistics
(
char
*
priData
,
char
*
data
,
int32_t
size
,
int32_t
numOfRow
,
int32_t
type
,
int64_t
*
min
,
int64_t
*
max
,
...
...
src/client/src/tscProfile.c
浏览文件 @
d04354a8
...
...
@@ -73,7 +73,7 @@ void tscSaveSlowQuery(SSqlObj *pSql) {
const
static
int64_t
SLOW_QUERY_INTERVAL
=
3000000L
;
if
(
pSql
->
res
.
useconds
<
SLOW_QUERY_INTERVAL
)
return
;
tscTrace
(
"%p query time:%ld sql:%s"
,
pSql
,
pSql
->
res
.
useconds
,
pSql
->
sqlstr
);
tscTrace
(
"%p query time:%l
l
d sql:%s"
,
pSql
,
pSql
->
res
.
useconds
,
pSql
->
sqlstr
);
char
*
sql
=
malloc
(
200
);
int
len
=
snprintf
(
sql
,
200
,
"insert into %s.slowquery values(now, '%s', %lld, %lld, '"
,
tsMonitorDbName
,
...
...
src/system/detail/src/vnodeRead.c
浏览文件 @
d04354a8
...
...
@@ -866,7 +866,8 @@ int vnodeSaveQueryResult(void *handle, char *data, int32_t *size) {
pQInfo
->
pointsRead
);
if
(
pQInfo
->
over
==
0
)
{
dTrace
(
"QInfo:%p set query flag, oldSig:%p, func:%s"
,
pQInfo
,
pQInfo
->
signature
,
__FUNCTION__
);
//dTrace("QInfo:%p set query flag, oldSig:%p, func:%s", pQInfo, pQInfo->signature, __FUNCTION__);
dTrace
(
"QInfo:%p set query flag, oldSig:%p"
,
pQInfo
,
pQInfo
->
signature
);
uint64_t
oldSignature
=
TSDB_QINFO_SET_QUERY_FLAG
(
pQInfo
);
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录