小编asa*_*adz的帖子

对 postgres 和 postmaster 服务的 CPU 使用率高进行故障排除?

我正在使用基于开源 (RHEL 6.2) 的机器运行 SIEM 软件。当我运行该top命令时,我看到postgrespostmaster两者的 CPU 使用率都为 96%。有没有办法确定或查看导致这些服务堆积的原因?

postgresql

40
推荐指数
4
解决办法
14万
查看次数

SQL where 子句对表的影响?

我有 sql 查询作为

select sourceIP, sum(sourceBytes) 
from flows
group by sourceIP
order by sum(sourceBytes) desc
Run Code Online (Sandbox Code Playgroud)

这带来的结果(虚拟)为:-

sourceIp     SourceBytes
192.168.1.2  100
192.168.1.3  79
192.168.1.4  67
192.168.1.5  4
192.168.1.6  4
Run Code Online (Sandbox Code Playgroud)

现在,如果我将查询更改为

select sourceIP, sum(sourceBytes) 
from flows
where sourceBytes > 50
group by sourceIP
order by sum(sourceBytes) desc
Run Code Online (Sandbox Code Playgroud)

输出为

 sourceIp        SourceBytes
 192.168.1.2     150
 192.168.1.3     40
Run Code Online (Sandbox Code Playgroud)

我现在无法访问数据库,我无法拉/显示真实的表值,但这里我想用greaterthen 语句说明输出已更改。我是第二个查询的视图,我只想处理结果而不是将flows表中的所有值处理为更大范围的值,即 50。我想知道这两个查询的级别不同。谢谢。

syntax

0
推荐指数
1
解决办法
59
查看次数

标签 统计

postgresql ×1

syntax ×1