加入收藏 | 设为首页 | 会员中心 | 我要投稿 济南站长网 (https://www.0531zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sql – 连续重复/重复的有序计数

发布时间:2021-01-24 10:41:25 所属栏目:MsSql教程 来源:网络整理
导读:副标题#e# 我非常怀疑我是以最有效的方式做到这一点,这就是我在这里标记plpgsql的原因.对于一千个测量系统,我需要在20亿行上运行它. 您有测量系统,当它们失去连接时经常报告先前的值,并且它们经常失去连接,但有时会长时间失去连接.您需要聚合,但是当您这样

Note: The current implementation of RETURN NEXT and RETURN QUERY
stores the entire result set before returning from the function,as
discussed above. That means that if a PL/pgSQL function produces a
very large result set,performance might be poor: data will be written
to disk to avoid memory exhaustion,but the function itself will not
return until the entire result set has been generated. A future
version of PL/pgSQL might allow users to define set-returning
functions that do not have this limitation. Currently,the point at
which data begins being written to disk is controlled by the 07002
configuration variable. Administrators who have sufficient memory to
store larger result sets in memory should consider increasing this
parameter.

考虑一次计算一个系统的行,或者为work_mem设置足够高的值以应对负载.请按照报价中提供的链接了解有关work_mem的更多信息.

一种方法是在函数中使用SET LOCAL为work_mem设置一个非常高的值,这仅对当前事务有效.我在函数中添加了一条注释行.不要在全局范围内设置它,因为这可能会破坏您的服务器.阅读手册.

(编辑:济南站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读