timescaledb

How to improve the performance of timescaledb getting last timestamp

白昼怎懂夜的黑 提交于 2021-02-11 06:48:27
问题 SELECT timeseries_id, "timestamp" FROM enhydris_timeseriesrecord WHERE timeseries_id=6661 ORDER BY "timestamp" DESC LIMIT 1; (The table contains about 66m records, and the ones with timeseries_id=6661 are about 0.5m.) This query takes about 1-2 seconds to run, which I find too much. If it was using a simple btree index, it should locate what it's looking for after about 30 iterations. As far as I can see when I execute EXPLAIN ANALYZE for that query, it does use the index, but it has to do so

How to improve the performance of timescaledb getting last timestamp

吃可爱长大的小学妹 提交于 2021-02-11 06:48:26
问题 SELECT timeseries_id, "timestamp" FROM enhydris_timeseriesrecord WHERE timeseries_id=6661 ORDER BY "timestamp" DESC LIMIT 1; (The table contains about 66m records, and the ones with timeseries_id=6661 are about 0.5m.) This query takes about 1-2 seconds to run, which I find too much. If it was using a simple btree index, it should locate what it's looking for after about 30 iterations. As far as I can see when I execute EXPLAIN ANALYZE for that query, it does use the index, but it has to do so

pg_dump with --exclude-table still includes those tables in the background COPY commands it runs?

只愿长相守 提交于 2021-01-29 13:52:46
问题 I am trying to take a backup of a TimescaleDB database, excluding two very big hypertables. That means that while the backup is running, I would not expect to see any COPY command of the underlying chunks, but I actually do! Let's say TestDB is my database and it has two big hypertables on schema mySchema called hyper1 and hyper2 , as well as other normal tables. I run the following command: pg_dump -U user -F t TestDB --exclude-table "mySchema.hyper1" --exclude-table "mySchema.hyper2" >

Invalid input syntax for type timestamp: “NOW() - INTERVAL '12 hours'”

人盡茶涼 提交于 2021-01-29 05:31:38
问题 I'm trying to make a query based on a field ``time` to get the last week data: Measure::where('time', '>', "NOW() - INTERVAL '12 hours'")->get(); but I can't make it work. I get this message: SQLSTATE[22007]: Invalid datetime format: 7 ERROR: invalid input syntax for type timestamp: "NOW() - INTERVAL '12 hours'" (SQL: select * from "measures" where "time" > NOW() - INTERVAL '12 hours') Thing is I get this condition from official docs of timescaleDB, supposed to be postgres compatible: SELECT

TimescaleDB query to select rows where column value changed from previous row

两盒软妹~` 提交于 2021-01-27 11:48:46
问题 Just recently started using TimescaleDB with postgrest to handle most requests for data. However I'm running into an issue where I have a horribly inefficient request for time series of data. It's a data series that can be any length of time, with specific Integer values. Most of the time the value will be the same unless there's an anomaly. So rather than fetching +10,000 rows of data. I would like to aggregate this into "time blocks". Let's say there 97 items in a row where the value is 100

TimescaleDB query to select rows where column value changed from previous row

只愿长相守 提交于 2021-01-27 11:43:23
问题 Just recently started using TimescaleDB with postgrest to handle most requests for data. However I'm running into an issue where I have a horribly inefficient request for time series of data. It's a data series that can be any length of time, with specific Integer values. Most of the time the value will be the same unless there's an anomaly. So rather than fetching +10,000 rows of data. I would like to aggregate this into "time blocks". Let's say there 97 items in a row where the value is 100

Add plpython3 Extension to Postgres/timescaledb Alpine Docker Image

十年热恋 提交于 2020-12-29 09:57:47
问题 I try to add the plpython3 extension to my timescaledb / postgres (based on linux alpine) image: FROM timescale/timescaledb:0.9.0-pg10 RUN set -ex \ && apk add --no-cache --virtual .plpython3-deps --repository http://nl.alpinelinux.org/alpine/edge/testing \ postgresql-plpython3 When I try to create the extension I get the following error: postgres=# CREATE EXTENSION plpython3u; ERROR: could not open extension control file "/usr/local/share/postgresql/extension/plpython3u.control": No such

postgresql数据库 TimescaleDB 定时压缩超表 删除超表(块)

自古美人都是妖i 提交于 2020-12-25 10:01:07
** postgresql数据库 TimescaleDB 定时压缩超表 删除超表(块) ** 在工作中 使用postgresql数据库 TimescaleDB 时序库进行存储实时数据,采集的数据量过大,提供的内存不足,因此考虑如何保存数据 TimescaleDB数据库中的超级表 TimescaleDB数据库自身带着函数就可以实现 ** TimescaleDB数据库所携带函数 一 .压缩 SELECT compress_chunk() ** 为了尽量不丢失数据,避免删除数据 我首先考虑把数据压缩,用他自带的函数 SELECT compress_chunk() 1查询时间 show_chunks() CREATE OR REPLACE FUNCTION "hrmw" . "show_chunks" ( "hypertable" regclass = NULL ::regclass , "older_than" any = NULL ::unknown , "newer_than" any = NULL ::unknown ) RETURNS SETOF "pg_catalog" . "regclass" AS '$libdir/timescaledb-1.7.1' , 'ts_chunk_show_chunks' LANGUAGE c STABLE COST 1 ROWS 1000

开放、普惠、高性能-SLS时序存储助力打造企业级全方位监控方案

拥有回忆 提交于 2020-08-15 15:14:43
无所不在的时序数据 时间带走一切,长年累月会把你的名字、外貌、性格、命运都改变。 ---柏拉图 随着时间的推移,万事万物都在不停的变化,而我们也会用各种数字去衡量这些变化信息,比如年龄、重量、速度、温度、金钱...在数字化时代中,我们会把这些随着时间变化的数据保存起来,挖掘这些数据的价值。通常我们会称这类数据为---时序数据。 时序数据用于描述物体在时间维度上的状态变化信息。 时序数据在各行各业都得到了非常广泛的应用,例如股票走势、交易趋势、服务器指标、脉搏心跳、定位坐标、能耗趋势等等,而这些数据几乎在所有的场景中都得到了应用,例如: 各类炒股软件提供众多不同维度的股票K线图,为广大股民提供参考标准; Apple Watch通过监控佩戴者的心率信息,帮助人们提早发现严重的心脏疾病; 国家电网通过分析各个小区、住户的用电量曲线,来判断是否有偷电漏电情况; 电商类的公司会监控平台的下单、交易、退货、评价等关键流程的变化趋势,用来快速发现各类异常; 各个游戏平台通过分析每个用户角色的操作、位置等变化规律,来判断是否使用了作弊辅助工具... 我们需要一个什么样的时序存储 为了能够支撑各种场景的时序分析、监控等需求,近几年在开源和商业领域均出现了一些时序存储的引擎,例如TimescaleDB、CrateDB、InfluxDB、OpenTSDB、Prometheus等

安装Zabbix5.0

荒凉一梦 提交于 2020-08-11 07:15:34
目录 概述 支持的平台 安全相关 支持TimescaleDB agent升级 垂直菜单 部署 安装要求 数据库要求 前端要求 服务端要求 Agent 2 Java gateway 安装 配置镜像源 安装数据库 添加源 安装 启动并设置开机自启 修改root密码 Zabbix server,Web前端,agent及相关依赖 创建初始数据库 为Zabbix server配置数据库 为Zabbix前端配置PHP 启动Zabbix server和agent进程 配置Zabbix前端 概述 Zabbix 5.0已经正式发布,相比4.0,它在可用性,安全性和完整性方面都有一系列重要改进。 支持的平台 除了现有的官方软件包和appliances外,Zabbix 5.0现在还支持以下平台: SUSE Linux Enterprise Server 15 Debian 10 Ubuntu 20.04 Raspbian 10 Mac OS/X RHEL 8 CentOS 8 MSI for Windows Agent 安全相关 SAML用于在安全身份提供者处提供单点身份验证,这意味着用户登录认证需要满足防火墙的安全策略,然后SAML用于向Zabbix和其他应用程序声明身份。SAML方式的支持使Zabbix具备开箱即用的与各种本地和云身份提供商(如Microsoft ADFS、OpenAM