最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How can I change symbol column capacity in QuestDB? - Stack Overflow

programmeradmin5浏览0评论

I created a table with default symbol capacity from ILP and I couldn't specify the capacity of the symbol/tag column when I sent the data. When I inspect the table I see that column node has the default capacity of 256.

CREATE TABLE IF NOT EXISTS table_raw (
    node symbol,
    timestamp timestamp,
    value double
) TIMESTAMP(timestamp)
PARTITION BY
    DAY DEDUP UPSERT KEYS (node, timestamp);

Given that this column has nearly 1 million distinct values, how can I increase the symbol capacity? Is there a way to not re-write the whole table since it's quite big now, nearly a billion rows?

I created a table with default symbol capacity from ILP and I couldn't specify the capacity of the symbol/tag column when I sent the data. When I inspect the table I see that column node has the default capacity of 256.

CREATE TABLE IF NOT EXISTS table_raw (
    node symbol,
    timestamp timestamp,
    value double
) TIMESTAMP(timestamp)
PARTITION BY
    DAY DEDUP UPSERT KEYS (node, timestamp);

Given that this column has nearly 1 million distinct values, how can I increase the symbol capacity? Is there a way to not re-write the whole table since it's quite big now, nearly a billion rows?

Share Improve this question asked Jan 20 at 10:57 Nick The GreekNick The Greek 4532 silver badges6 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

As of v8.2.1 QuestDB does not support altering symbol capacity of the existing column. The only workaround to change the capacity without copying the whole table is to convert the column as varchar and then back to symbol of a higher capacity:

alter table tbl alter column sym type varchar;
alter table tbl alter column sym type symbol capacity 1000000 NOCACHE;
发布评论

评论列表(0)

  1. 暂无评论