For tables that do time aggregation and daily aggregation, the column type was changed without a problem and there were no problems. The current problem occurred in the monthly aggregate table.
This table accumulates about 100 million rows per day.
There are too many unique values in ip that are not duplicated, so I changed ip to varchar.
When I changed the table, the order of ip changed to the back.
Is it possible that the order of columns changes when changing the type of a table column?
Could this be causing the problem above?
alter table network_traffic alter column device_id type symbol;
When I changed the symbol with the query, the capacity was set to a value that was too large.
The org_id consists of 30 unique values.
The device_id consists of 200 unique values.
this is orginal table, but
Originally, organization_id, device_id, dst_ip IDs were symbols, but in the case of varchar vs symbol, they were changed to test ilp performance.
CREATE TABLE 'traffic_dst_min_test' (
organization_id VARCHAR,
device_id VARCHAR,
dst_ip VARCHAR,
domain SYMBOL,
lan_tcp_up_bytes LONG,
lan_tcp_down_bytes LONG,
lan_udp_up_bytes LONG,
lan_udp_down_bytes LONG,
wan_tcp_up_bytes LONG,
wan_tcp_down_bytes LONG,
wan_udp_up_bytes LONG,
wan_udp_down_bytes LONG,
ts TIMESTAMP
) timestamp (ts) PARTITION BY HOUR WAL;
insert into traffic_dst_min_test
select
organization_id,
device_id,
dst_ip,
case
when cast(dst_ip as ipv4) is null then dst_ip
else null
end domain,
lan_tcp_up_bytes,
lan_tcp_down_bytes,
lan_udp_up_bytes,
lan_udp_down_bytes,
wan_tcp_up_bytes,
wan_tcp_down_bytes,
wan_udp_up_bytes,
wan_udp_down_bytes,
ts
from
traffic_dst_min
where
ts IN '2024-11-11';
alter table traffic_dst_min_test alter column organization_id type symbol;
alter table traffic_dst_min_test alter column organization_id add index;
alter table traffic_dst_min_test alter column device_id type symbol;
alter table traffic_dst_min_test alter column device_id add index;
After restarting, the symbol’s capacity was resolved.
Okay great, I think this is just a visual bug. The UI is served by a cache which may not be given a consistent view of the symbol capacity. Since it is fixed on a restart, this means tha cache is re-hydrated by reading from disk, and the correct capacity is read.