Nick The Greek
Nick The Greek

Reputation: 453

How can I change symbol column capacity in QuestDB?

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?

Upvotes: 0

Views: 29

Answers (1)

Alex des Pelagos
Alex des Pelagos

Reputation: 1485

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;

Upvotes: 0

Related Questions