在将行插入到QuestDB表中时,我遇到了摄取时间问题。表定义:
create table trade1 (
id symbol,
buy_order_id string,
currency string,
price float,
quantity float,
instrument_id symbol,
sell_order_id string,
status string,
subtype symbol,
"type" string,
transact_time timestamp,
buy_trader_id string,
sell_trader_id string);
) timestamp(transact_time) PARTITION BY DAY;我有一个ETL进程,它从CSV文件中提取数据,并使用JDBC Postgrs驱动程序插入数据。
当我在第一个文件的空表上插入数据时-大约300k行需要大约60秒的时间。然而,对于第二个文件,它需要更长的时间-180秒。第四个文件超过10分钟。
所有文件在行数上都是相似的。
此外,当我只保留一个symbol列时,它看起来更快,但随着插入更多的行,速度会降低:
create table trade1 (
id string,
buy_order_id string,
currency string,
price float,
quantity float,
instrument_id symbol,
sell_order_id string,
status string,
subtype string,
"type" string,
transact_time timestamp,
buy_trader_id string,
sell_trader_id string);
) timestamp(transact_time) PARTITION BY DAY;插入时间: 15s,19s,29s,37s,35s,59s,62s,74s,这样它就会不断增长。
摄取时间似乎与插入的行数一起增长,但在甚至没有定义索引的情况下,这怎么可能呢?
server.conf:
data:
server.conf: |
cairo.sql.append.page.size = 256
pg.worker.affinity = 1,2,3,4
pg.worker.count = 4
shared.worker.count = 2QuestDB使用Helm chart部署在Kubernetes上。
我是否遗漏了一些核心概念?
发布于 2021-10-13 01:01:41
如果您将instrument_id从符号更改为字符串,它仍然表现出速度慢吗?
如果您可以“按原样”摄取源CSV,那么REST导入的速度就快得离谱。
在我的基准测试中,与REST /imp和InfluxDB线路协议相比,使用PostgreSQL线路协议是最慢的(耗时2-3倍)。
https://stackoverflow.com/questions/69118798
复制相似问题